Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

ActionJavaScript Delete

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    ActionJavaScript Delete

    I have a grid and I want to add an actionJavaScript button that will delete the row of data it's on. How do I do that? Checking the checkbox "Allow delete" in the Update Settings is breaking the grid for some reason and you get the error
    Code:
         
    Fatal error running a5_ajax_grid(): Property not found tmpl.preCalc.Javascript.GridRow_To_EditMode subelement not found. on line 1642 in 1000199:pl
    How do I add an action javascript button to delete the row of data in the grid?

    #2
    Re: ActionJavaScript Delete

    Okay I added a button and have defined the following onClick event;
    Code:
     var row = {grid.Object}.getSelectedRow();
    {grid.Object}.deleteRow(row);
    But I get an error message saying 'Grid does not allow deletes'. What do I do?

    Comment


      #3
      Re: ActionJavaScript Delete

      Is it a simple grid? Can you remake it? It sounds like there may be a glitch somewhere. Sometimes that happens and remaking the component fixes it, at least in regards to your first error.

      If that's not the problem, then there must be something simple that's wrong. For instance, you can't allow CRUD operations on a grid unless you include the primary key in the query.

      An example of what you've got would be helpful for someone to solve your problem. There are several types of grids and several ways you could set this up so it will take forever for anyone to figure out exactly what you've got going on.

      Comment


        #4
        Re: ActionJavaScript Delete

        Primary key has been specified. This grid has a parent or displays when you click the small + sign on the Parent. Any idea at all on why that error would occur when I check the 'Allow delete' checkbox would be greatly appreciated. Give me all the reasons you can think of.

        Comment


          #5
          Re: ActionJavaScript Delete

          I don't know what would be causing the error. It sounds like a bug to me. If you can make a sample component and get it to reproduce the error (using northwind db or static data so it can be tested) you can upload that here for us to look at or send it in as a bug to alpha.

          If you need it to work NOW, you could write Xbasic to delete it instead through an Ajax callback.

          Comment


            #6
            Re: ActionJavaScript Delete

            http://screencast.com/t/zvJRhQyZBKia

            are you doing this way? from the description it does appear to me.
            thanks for reading

            gandhi

            version 11 3381 - 4096
            mysql backend
            http://www.alphawebprogramming.blogspot.com
            [email protected]
            Skype:[email protected]
            1 914 924 5171

            Comment


              #7
              Re: ActionJavaScript Delete

              What's the Xbasic code?

              Comment


                #8
                Re: ActionJavaScript Delete

                This solution is not very clear. I am using a grid and I previously attached an ActionJavaScript onClick definition that says;
                var row = {grid.Object}.getSelectedRow();
                {grid.Object}.deleteRow(row);

                Where would I put the {controlDef.system:Delete}? I am using a grid so the only way to add something new is by clicking the 'Insert' link, choose button and then go define it. This solution is very vague and I guess assumes the user is an expert in Alpha. I am no expert.

                Comment


                  #9
                  Re: ActionJavaScript Delete

                  One thing I left out but I don't think it's critical. The table from which the grid is pulling info has a primary key and a foreign key. The binding section only asks for a primary key so I specified only one key and yes, it is an auto_increment.

                  Comment


                    #10
                    Re: ActionJavaScript Delete

                    Okay I got things working. One last problem, how do I refresh the grid in Xbasic? Instead of using Action JavaScript, I defined the onClick event as an Xbasic Function. The record in the table deletes fine but now you won't know it unless you click the 'Refresh' button. So from the Xbasic Function definition, how do I refresh the grid for the user?

                    Comment


                      #11
                      Re: ActionJavaScript Delete

                      What does your Xbasic look like?
                      At the end of your Xbasic function do something like this.
                      Code:
                      dim jscmd as c = "{grid.Object}.refresh();"
                      YourXbasicFunctionName = jscmd
                      That will pass some javascript back to the client. You can build any javascript you want this way and send it back.

                      Also, please share how you fixed your problem so that this post is useful to other users.

                      Comment


                        #12
                        Re: ActionJavaScript Delete

                        Thanks much. Did not use it exactly as you have it here. The Xbasic Function option for an onClickEvent is called;
                        Code:
                        function serverside_b12cbbafda284b90b709994bed9b8c7a as c (e as p)
                        so I defined the return value like this, which is at the top of the function definition window;
                        Code:
                        serverside_b12cbbafda284b90b709994bed9b8c7a = "{grid.Object}.refresh();"
                        Once again thanks. If anyone is really interested in the xbasic code I used let me know and I'll post it here.

                        Comment


                          #13
                          Re: ActionJavaScript Delete

                          Ah, I see. You are using the Xbasic tab inside the button instead of an Ajax callback. I was envisioning a callback and the code being in the Xbasic functions on the left side of the builder.

                          Comment

                          Working...
                          X