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

How do I use a button to call/open Grid in a modal window

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

    How do I use a button to call/open Grid in a modal window

    I have placed a button on the grid toolbar that I want to use to Insert a new record via another grid. I know there is a video demonstrating how to place a button and do an ajax callback and maybe that's what I need but I am not sure. If someone can help, I would appreciate it.�

    #2
    Re: How do I use a button to call/open Grid in a modal window

    The way I do it is have the button open a detail view in the new record mode.

    Just set the onclick method of the button to;
    onclick="{grid.Object}.detailViewNewRecord()"
    Win 10 64 Development, Win 7 64 WAS 11-1, 2, Win 10 64 AA-1,2, MySql, dbForge Studio The Best MySQL GUI Tool IMHO. http://www.devart.com/dbforge/mysql/studio/

    Comment


      #3
      Re: How do I use a button to call/open Grid in a modal window

      Thanks for your reply! This is a button I've added to the bottom/footer of the grid. I added the onclick function to it but it throws an error. Is there a step I am missing having placed it on the bottom of the grid?

      Also,

      I need to link the grid on certain fields also. I can easily add a button into the row and use the javascript onclick option that is available under field properties but I am trying to keep it clean and a button for everyone row is unnecessary. Is there a different process when you are inserting it into the grid toolbar template?

      Comment


        #4
        Re: How do I use a button to call/open Grid in a modal window

        Hi

        As you say, start with a row based button and use action javascript wizard to open the grid or perform any function you want until it works. You will remove the button from the rows later.

        In the action javascript editor, toggle to Textmode. Copy the code in the Declarations-Global tab to the clipboard.

        Go to grid properties, Javascript function declaration and paste the code as is.

        Go back to the action javascript editor for the row based button code, toggle again to Textmode. Copy the code in the Javascript Attribute tab to any text editor. It should look similar to this:
        Code:
        {grid.componentName}_G__UNBOUND_BUTTON_1_1({grid.rownumber},'{grid.rowId}',this);
        change it to something like this
        Code:
        {grid.componentName}_G__UNBOUND_BUTTON_1_1(1,'1',this);
        Paste the changed call in the onclick() of your button in the toolbar, i.e.
        Code:
        ...onlick()="{grid.componentName}_G__UNBOUND_BUTTON_1_1(1,'1',this);"
        Remove the row based button and its code.

        Cheers, Wolfgang

        Comment


          #5
          Re: How do I use a button to call/open Grid in a modal window

          Peter,

          I can't thank you enough. Worked perfectly. Thanks for spelling it out for me, I appreciate it!

          Comment


            #6
            Re: How do I use a button to call/open Grid in a modal window

            Hi Josh,

            Could you share what you have done? the screenshot please.

            Thanks,
            Andy

            Comment


              #7
              Re: How do I use a button to call/open Grid in a modal window

              Peter,

              Is there a reason that this would work in a live preview within alpha but not once published and launched within a browser?

              Comment


                #8
                Re: How do I use a button to call/open Grid in a modal window

                Something may not be getting published to your server. It should work. Open your grid and click one of the browse icons. Then publich to localhost and test it there as well.
                Peter
                AlphaBase Solutions, LLC

                [email protected]
                https://www.alphabasesolutions.com


                Comment


                  #9
                  Re: How do I use a button to call/open Grid in a modal window

                  It works when I use the browse icon to launch it but even after re-publishing it locally...The function does not work outside of alpha5. Should I post the code? I am sure it is something I have done wrong.

                  Comment


                    #10
                    Re: How do I use a button to call/open Grid in a modal window

                    Originally posted by wmz View Post
                    Hi

                    As you say, start with a row based button and use action javascript wizard to open the grid or perform any function you want until it works. You will remove the button from the rows later.

                    In the action javascript editor, toggle to Textmode. Copy the code in the Declarations-Global tab to the clipboard.

                    Go to grid properties, Javascript function declaration and paste the code as is.

                    Go back to the action javascript editor for the row based button code, toggle again to Textmode. Copy the code in the Javascript Attribute tab to any text editor. It should look similar to this:
                    Code:
                    {grid.componentName}_G__UNBOUND_BUTTON_1_1({grid.rownumber},'{grid.rowId}',this);
                    change it to something like this
                    Code:
                    {grid.componentName}_G__UNBOUND_BUTTON_1_1(1,'1',this);
                    Paste the changed call in the onclick() of your button in the toolbar, i.e.
                    Code:
                    ...onlick()="{grid.componentName}_G__UNBOUND_BUTTON_1_1(1,'1',this);"
                    Remove the row based button and its code.

                    Cheers, Wolfgang
                    Anybody know why this will not work in a linked grid? When I do it from the parent grid it works OK but from a linked child grid it generates an error 'object expected' It works OK in the working preview but not when published. I have tried it on several different grids and get the same result. As a matter of fact if I put just a basic js function call to display an alert message in the onclick method I get the same result.
                    Win 10 64 Development, Win 7 64 WAS 11-1, 2, Win 10 64 AA-1,2, MySql, dbForge Studio The Best MySQL GUI Tool IMHO. http://www.devart.com/dbforge/mysql/studio/

                    Comment


                      #11
                      Re: How do I use a button to call/open Grid in a modal window

                      Hi

                      I think it is the same issue we had with Tabbed UI's. The action javascript code to open a grid in a pop-up etc. must be defined in the parent grid, i.e. if I have the following customized toolbar HTML in the child grid (linked content) that defines a toolbar button ...
                      Code:
                      <tr>
                        <td colspan="{grid.colspan}" class="{Grid.style}FooterTD" nowrap="nowrap" >
                      	<table cellspacing="0" border="0" cellpadding="0" style="width:100%;">
                      		<tr>
                      			<td nowrap="nowrap" align="{grid.RecordNavigatorAlignment}">
                      					{grid.GridViewAddNewRecordHyperlink} {grid.RecordNavigatorButtons} {grid.RecordsPerPage}&nbsp;&nbsp;&nbsp;{grid.toggleQBERowHyperlink}
                      			</td>
                      			<td nowrap="nowrap" align="right">
                      					{grid.grid_part.submitbuttons}
                      			</td>
                      			<td nowrap="nowrap" align="right">
                      				[B][COLOR="Red"]<button type="button" onclick="MyWindow(1,'1',this);">Call</button>[/COLOR][/B]
                      			</td>
                      
                      		</tr>
                      	</table>
                      </td>
                      </tr>
                      ... then the code for MyWindow must be defined in the js function declaration of the parent grid, something similar to this:

                      Code:
                      window['MyWindow'] = function(rowNum,rowId,objEle) {
                      
                      var windowName = 'WINDOW_eddd56a1_55ba_4fe4_8405_770c444b8048';
                      var currWindow = {Grid.object}.getWindow(windowName);
                      
                      var go = new Object();
                      go.objectId = objEle.id;
                      go.gridName = 'GRD_ROLES';
                      go.alias = '{Grid.componentname}_GRD_ROLES_yrah';
                      go.submitCurrentFieldValues = true;
                      
                      ... and so on	
                      	
                      };
                      Note that I use explicit window naming (here: MyWindow[]), i.e. I changed the window name given by the action js wizard so it is easier to call it.

                      I haven't fully tested this, nor have I tried, however, to pass child grid data to the action js function that opens the pop-up....

                      cheers

                      Comment


                        #12
                        Re: How do I use a button to call/open Grid in a modal window

                        Thank you Wolfgang, This should work well for my process. I am simply opening a grid to select some records to add to the linked grid. I am able to get all of my references and data from sql queries and from an id in a session variable.
                        Win 10 64 Development, Win 7 64 WAS 11-1, 2, Win 10 64 AA-1,2, MySql, dbForge Studio The Best MySQL GUI Tool IMHO. http://www.devart.com/dbforge/mysql/studio/

                        Comment


                          #13
                          Re: How do I use a button to call/open Grid in a modal window

                          Wolfgang,
                          I was able to put the reference to a hidden button on the parent grid in the javascript function declarations section of the parent grid (single record form). This function is called by a button in the grid toolbar of the child grid. The hidden button on the parent grid opens the grid that I want to select the records from.
                          At first I didn't like the idea of having a hidden button(s) on the grid, I don't know why it just seemed like there should be a more efficient way, however, after trying a few different methods this is the best for me. A button sitting there doing nothing unless clicked on, or in my case called from a function, really does not use any more resources and it It makes it very easy to change the action javascript, etc in the hidden buttons properties.
                          Thanks again for pointing me in the right direction.

                          Code:
                           in the javascript function declarations of the parent grid;
                          
                          function SelectReceivedItems()
                          {{grid.componentName}_G__UNBOUND_BUTTON_4_1(1,'1',this);}
                          
                          in the customize grid toolbar template on the linked child grid;
                          
                          <td>
                          	<button class="GlassBlueButton"
                          		onclick="SelectReceivedItems();" >
                          		Select Received Items
                          	</button>
                          </td>
                          Win 10 64 Development, Win 7 64 WAS 11-1, 2, Win 10 64 AA-1,2, MySql, dbForge Studio The Best MySQL GUI Tool IMHO. http://www.devart.com/dbforge/mysql/studio/

                          Comment


                            #14
                            Re: How do I use a button to call/open Grid in a modal window

                            well done. Many roads lead to Rome :) The main thing is that it works and that you know why ....

                            Comment


                              #15
                              Re: How do I use a button to call/open Grid in a modal window

                              hi,

                              i have copied the process here to add a button to my toolbar, which is ok, but the button wont fire the actions. it works ok if the button is in the row but i dont need a button each row.

                              here is the code in the 'Javascript Functions Declarations'

                              Code:
                              window['{grid.componentName}_G__UNBOUND_BUTTON_1_1'] = function(rowNum,rowId,objEle) {
                              window['{Grid.ComponentName}__UNBOUND_BUTTON_1_1'] = {grid.object}.createWindow('{grid.componentName}_WINDOW__UNBOUND_BUTTON_1_1','modal-url-resizable',{height: '5in',
                              width: '8in',
                              title: {html: 'Window',
                              location: 'top'},
                              disableMove: false,
                              body: {content: {type: 'url',
                              url: '__workingMessage.a5w'}},
                              onHide: function() { $(this.getWindowId('body')).src = '__workingMessage.a5w';}}   );
                              window['{Grid.ComponentName}__UNBOUND_BUTTON_1_1'].show();
                              $(window['{Grid.ComponentName}__UNBOUND_BUTTON_1_1'].getWindowId('body')).src = 'adv_case_new.a5w?session.caseparent='+{grid.object}._getValue('G','CASE_PARENT_ID',rowNum)+'&session.firstname='+{grid.object}._getValue('G','CLIENTFIRSTNAME',rowNum)+'&session.surname='+{grid.object}._getValue('G','CLIENTSURNAME',rowNum)+'&session.title='+{grid.object}._getValue('G','CLIENTTITLE',rowNum)+'&session.branch='+{grid.object}._getValue('G','BRANCH',rowNum)+'&session.fileloc='+{grid.object}._getValue('G','FILELOCATION',rowNum)+'&session.hometel='+{grid.object}._getValue('G','CLIENTTELHOME',rowNum)+'&session.mobile='+{grid.object}._getValue('G','CLIENTTEL_MOBILE',rowNum)+'&session.adviser='+{grid.object}._getValue('G','ADVISER',rowNum)+'&session.dob='+{grid.object}._getValue('G','CLIENTDOB',rowNum)+'&session.dpar='+{grid.object}._getValue('G','DPA_REVIEW',rowNum)+'&session.dpan='+{grid.object}._getValue('G','DPA_NEWSLETTER',rowNum)+'&session.dpat='+{grid.object}._getValue('G','DPA_THIRDPARTY',rowNum)+'';
                              
                              }
                              here is the code int he customise toolbar

                              Code:
                              <tr>
                              	<td colspan="{grid.colspan}" class="{Grid.style}FooterTD" nowrap="nowrap" align="{grid.RecordNavigatorAlignment}" >
                              	{grid.DetailViewAddNewRecordHyperlink}
                              	{grid.RecordNavigatorButtons} 
                              	{grid.RecordsPerPage}&nbsp;&nbsp;&nbsp;
                              	{grid.toggleQBERowHyperlink}
                              <button onclick()="{grid.componentName}_G__UNBOUND_BUTTON_1_1(1,'1',this);">Add new case for this client</button>
                              	</td>
                              </tr>
                              i have been at this for hours, the button clicks but does nothing

                              Comment

                              Working...
                              X