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

Problem setting variable

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

    Problem setting variable

    I am trying to create a variable named CompName by using the onRowSelect event using the method below:
    var CompName = {grid.object}.getValue('G','COMPANYNAME',{grid.rowNumber});

    The purpose of this is...I have a read-only grid named Donors. It has a detail view and I have also linked a few grids to it to provide additional information. I am using a tab container to access the linked grids. I want to dynamically set the name of the TabBand to include the CompName variable. It will make it more obvious to my user's that they are looking at the Donor specific details. The problem could be where I am firing the client-side event because there is already an event that occurs when the row is selected. It opens the detail view. Any direction is appreciated!

    Thanks!

    #2
    Re: Problem setting variable

    Hey Josh, did you get this solved?

    A screen shot of what you're trying to do would be really helpful... showing the grid you're starting with and then the tab container... and where you want your CompName to show up.

    You have a grid, with a detail view. On the detail view you get to the linked grids - how? And the linked grids are sitting in a tab container?

    Comment


      #3
      Re: Problem setting variable

      David,

      Thanks for the reply. Attached is a screenshot. The detail view opens in a div on the right hand side. I've used the master layout template and have the detail view opening inside of a div that opens below two linked grid's that exist inside of a tab control. Donations and Communications are my linked grids. The screenshot I believe will make clear what I am trying to accomplish. I want to dynamically set the name of the tab band to reflect the name of the Donor when a user click's on the donor's record from the read-only grid part.
      Attached Files

      Comment


        #4
        Re: Problem setting variable

        Hey Josh,

        I duplicated enough of your setup to get done what you'd like... I think. How did you get your linked grids into the Accordian Tab? I can't remember where that is?

        Anyway... to get some of this stuff done you need to know what you're dealing with at the HTML level... and for that you need Firefox and Firebug. If you've got those installed and you run your grid under Firefox, and then right-click on the title "Communications"... you actually get nothing... no right-click menu... 'cause Firefox doesn't think anything is there. So, just right-click into one of your detail view fields and choose Inspect Element with Firebug. In the HTML code window you can move you cursor up in the code until the Communications title is highlighted. Then you have to review what you're looking at to see if the title is all wrapped up in some nice HTML... and indeed it is. Here is what mine looks like in code...

        Code:
        <a id="GRID1_DVTAB_1R_1.0.TITLE" class="GrGrayAccordionButton" href="?A5wSessionId=8c917eda1c6b437cbd09a368b6338d19#" a5accordionctrlindex="0">Communications</a>
        So... we have an ID... and that's all we need.

        In your Grid's Client-side Events, onRowSelect put this code...

        Code:
        //var tabTitle = $('{Grid.ComponentName}_DVTAB_1R_1.0.TITLE').innerHTML;
        
        //place this Javascript in your code, and then reference the rowNum variable.
        var rowNum = {Grid.Object}._selectedRow;
        var prodName = {grid.Object}.getValue('G','PRODNAME',rowNum);
        
        var newTitle = prodName + " : " + "Communications"
        
        $('{Grid.ComponentName}_DVTAB_1R_1.0.TITLE').innerHTML = newTitle;
        Here we're getting the current row, grabbing a value from the grid (replace PRODNAME with DONORNAME), putting together the new title and setting that title back into the page.

        You'll notice the 1st line is commented out. I wanted to grab the current title - just so we can be more variable - and then use that to create the new title. The problem is... onRowSelect gets fired twice when the grid is first displayed. That creates a title that has double values in it. So... hard code it, unless you can figure out a way around it.

        Now... you'll have to go and get your Donations info, and add it to the code.

        Hope that works for you... and helps.

        Comment


          #5
          Re: Problem setting variable

          Thanks very much. This makes sense to me but I am having trouble making it work. Here is my modified script based on the example you provided. The grid runs within a tabUI so I launched it from there because my understanding is that the ID will change when you are opening components/dialogs within a tabUI. Can you see anything wrong with what I have below?

          Used firebug to inspect and get the id of the element.
          Here is the html/id of the tab element:

          <a id="TBI_DONORS_12318OSUA_MASTERTEMPLATE.1.TAB" class="GrBlue_ModifiedTabRButton" href="#" a5tabctrlindex="1">Communications</a>

          CompanyName is the field in my table.

          Here is the modified script:
          Code:
          var rowNum = {Grid.Object}._selectedRow;
          var CompName = {grid.Object}.getValue('G','CompanyName',rowNum);
          
          var newTitle = CompName + "'s" + " : " + "Communications"
          
          $('{Grid.ComponentName}_TBI_DONORS_12318OSUA_MASTERTEMPLATE.1.TAB').innerHTML = newTitle;)

          Comment


            #6
            Re: Problem setting variable

            Why do things get left out!!! Sheesh. Future note... if your grid runs in a tab... say it runs in a tab. Everything is different depending on what you're doing... ok... end of small rant

            When I ran this, my id was actually GRID1_DVTAB_1R_1.0.TITLE

            But, to make things a bit more variable we usually replace the GRID1 part with an Alpha placeholder... in this case {Grid.ComponentName} which, when rendered gets changed to GRID1.

            In your case, Josh, ignore this part and just use the literal id... TBI_DONORS_12318OSUA_MASTERTEMPLATE.1.TAB

            Your last line is a bit wrong as well... your ending paren ) shouldn't be there. You line will be...

            Code:
            $('TBI_DONORS_12318OSUA_MASTERTEMPLATE.1.TAB').innerHTML = newTitle;
            Further, on your getValue statement, COMPANYNAME must be in uppercase. That's an Alpha rule.

            Finally, I'm not sure what your apostrophe s "'s" is going to do. You may have to "escape" that part. See if it works first. If not try...

            Code:
            var newTitle = CompName + "\'s" + " : " + "Communications"
            Putting a \ in front of a special character will cause that character to be used literally... instead of a code quote.

            See how all that works out.

            EDIT: A final note... if it's giving you trouble, then check your Accordion Tab Heading again under Firebug... make sure it's getting rendered the same way each time. On occasion, not sure why, the numbers inside the id change.
            Last edited by Davidk; 07-21-2012, 07:19 PM.

            Comment


              #7
              Re: Problem setting variable

              Sorry that I failed to mention that I was using a tabUI for this app.

              Comment


                #8
                Re: Problem setting variable

                It's beautiful, the only issue I have now is that the detail view also opens with a single row click and it's wreaking havoc. Any idea of a way to make it play nice? Thanks a lot David, this was really helpful.

                Comment


                  #9
                  Re: Problem setting variable

                  If you know of a way to not have the two conflict that is great, if not I will use a different method to open the detail part of the grid. Thanks again man! You are awesome.

                  Comment


                    #10
                    Re: Problem setting variable

                    There is an onRowFocus, but that's only if your Grid is editable. You want the Accordion title to change every time the row changes... so onRowSelect is the only way, I think. Do you mind changing the Detail View to a hyperlink?

                    I really like your grid design, by the way... Detail View with Tab stuff on top. So... when it's running you get either the Detail View or Communications or Donations... is that right? The Communication and Donations push the Detail View out of the way?

                    Comment


                      #11
                      Re: Problem setting variable

                      That's right. I played with a few layout's and that's the one I felt was most functional. Still working on trying to make everything a little prettier as that is not my strong-suit.

                      Comment


                        #12
                        Re: Problem setting variable

                        No... me neither... I can tell if it looks good... but trying to get is there... I'm a bust.

                        How do you get the linked grids into the Accordion Tab?

                        Comment


                          #13
                          Re: Problem setting variable

                          David,

                          Sorry for the slow response. I create the linked grids/content. I use the master layout option and one of the pre-defined templates you will notice in there is for a tab and accordion container among others. Then it's just a matter of placing the grid parts/linked grids in the appropriate div's.

                          Comment


                            #14
                            Re: Problem setting variable

                            I remember seeing that... didn't go into it though... thanks... going to have another look.

                            Comment

                            Working...
                            X