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

Grid Detail Column Heading JS syntax

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

    Grid Detail Column Heading JS syntax

    That's a mouthful. I need to be able to dynamically change the label (i.e. column heading) of certain fields in a grid's detail section. I have a radio button control which has a JavaScript OnChange event which works perfectly. e.g. It is easy to change another field's value:
    Code:
    vStatus = {grid.Object}._getValue('D','CHARG_STAT');
    
    switch (vStatus)
    {
    case 'Charge':
      vCode = 'A';
      break;
    case 'Credit':
       vCode = 'B';
      break;
    case 'N/C':
      vCode = 'C';
      break;
    case 'N/C-Exclude':
      vCode = 'D';
      break;
    default:
      vCode = 'A';
    }
    
    {grid.Object}._setValue('D','CHARG_CODE',vCode);
    Alpha gives us the syntax to read/write a field value w. the {grid.Object}._getValue() & {grid.Object}._setValue(). But I don't see any similar functionality to get at the field's column heading. Are there any JS experts out there who know how to read/write the label?


    P.S. I think the xbasic equivalent is: detailField_info[60].Column.Heading = "Hours". But I need client side functionality, so xbasic doesn't work.
    Peter
    AlphaBase Solutions, LLC

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



    #2
    Re: Grid Detail Column Heading JS syntax

    This should do it.

    http://support.alphasoftware.com/Wha...le%20Languages

    Sorry - didn't see the Java Request. Handy link anyhow.
    Last edited by peteconway; 10-22-2009, 06:09 AM.
    Insanity: doing the same thing over and over again and expecting different results.
    Albert Einstein, (attributed)
    US (German-born) physicist (1879 - 1955)

    Comment


      #3
      Re: Grid Detail Column Heading JS syntax

      Originally posted by peteconway View Post
      This should do it.

      http://support.alphasoftware.com/Wha...le%20Languages

      Sorry - didn't see the Java Request. Handy link anyhow.
      Thanks, Actually, I tried using the language support, but I couldn't get it to fire in the context of a field's OnChange event. I don't believe that language support is dynamic in that context.
      Peter
      AlphaBase Solutions, LLC

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


      Comment


        #4
        Re: Grid Detail Column Heading JS syntax

        Yes Peter it can be used to change labels to any value you want, Instead of defining a language you just define a second option for your labels.
        but do you want the labels to change in real time? (no page refresh)
        Cheers
        Mauricio

        Comment


          #5
          Re: Grid Detail Column Heading JS syntax

          Originally posted by mmaisterrena View Post
          Yes Peter it can be used to change labels to any value you want, Instead of defining a language you just define a second option for your labels.
          but do you want the labels to change in real time? (no page refresh)
          Thanks, Mauricio. Yes. Like I said I tried it. I need to be able to dynamically change the label based upon a field value. But I found the answer (I think):

          http://support.alphasoftware.com/Wha...0Field%20Label

          Just have to test it in the context of a detail section.
          Peter
          AlphaBase Solutions, LLC

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


          Comment


            #6
            Re: Grid Detail Column Heading JS syntax

            For anyone interested...

            The sample JavaScript code in the above link works as advertised for the grid part of a grid, but not for the detail part. Here is the difference:

            GRID PART:
            $('{grid.componentname}.LBL.R' + data.rowNumber + '.' + 'HRS_QTY' + '').innerHTML = vHrs_Qty_Label;

            DETAIL PART:
            $('{grid.componentname}.D.LBL.R' + data.rowNumber + '.' + 'HRS_QTY' + '').innerHTML = vHrs_Qty_Label;

            In the above example HRS_QTY (CAPS required) is the field and
            vHrs_Qty_Label is the variable.

            Thanks to Selwyn for clarifying this!
            Peter
            AlphaBase Solutions, LLC

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


            Comment


              #7
              Re: Grid Detail Column Heading JS syntax

              Originally posted by Peter.Greulich View Post
              For anyone interested...

              The sample JavaScript code in the above link works as advertised for the grid part of a grid, but not for the detail part. Here is the difference:

              GRID PART:
              $('{grid.componentname}.LBL.R' + data.rowNumber + '.' + 'HRS_QTY' + '').innerHTML = vHrs_Qty_Label;

              DETAIL PART:
              $('{grid.componentname}.D.LBL.R' + data.rowNumber + '.' + 'HRS_QTY' + '').innerHTML = vHrs_Qty_Label;

              In the above example HRS_QTY (CAPS required) is the field and
              vHrs_Qty_Label is the variable.

              Thanks to Selwyn for clarifying this!
              I discovered this syntax ony works in a watch event for DB fields, non-DB fields were not shown in selection window. I need a solution that you can use in a Button/Image/Static Text OnClick event.
              Last edited by graycoder63; 02-07-2010, 06:16 PM.

              Comment


                #8
                Re: Grid Detail Column Heading JS syntax

                Originally posted by graycoder63 View Post
                I discovered this syntax ony works in a watch event. Did you find a solution that you can use in a field's OnClick event.
                No. I use it in a watch event.
                Peter
                AlphaBase Solutions, LLC

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


                Comment


                  #9
                  Re: Grid Detail Column Heading JS syntax

                  Here's a neat little trick that I will make into a short video when I get a chance.

                  Instead of entering the label text, create a div for the label text, then populate that div by setting the innerHTML property of the div through one of the many available Javascript events.

                  So for the label enter something like :

                  <div id="label_1"></div>

                  Now through any applicable Javascript event enter:

                  $('label_1').innerHTML='My New Label';
                  Bob Moore


                  Comment


                    #10
                    Re: Grid Detail Column Heading JS syntax

                    I can get this to work in a grid but not in Detail View.
                    Firefox traced the error to A5.JS line 3166
                    else return this._newDVValues[colNum];
                    with error code this._newDVValues is undefined
                    Build 3523
                    I created a DB with 3 fields
                    MemberID N4
                    Company C10
                    Zip C10

                    Code in watch event Detail View for Company is:
                    var COMPANY = *gv('COMPANY');
                    var labelValue = 'Zip code';
                    if( COMPANY != 'USA') labelValue = 'Postal Code';
                    $('{grid.componentname}.D.LBL.R' + data.rowNumber + '.'+'ZIP'+'').innerHTML = labelValue;

                    Comment


                      #11
                      Re: Grid Detail Column Heading JS syntax

                      Thanks Bob

                      Works.

                      I really appreciate you and the other guru's gracious contributions.

                      You must not have a life outside of Coding and Photography.

                      Ralph

                      Comment


                        #12
                        Re: Grid Detail Column Heading JS syntax

                        Originally posted by Bob Moore View Post
                        Here's a neat little trick that I will make into a short video when I get a chance.

                        Instead of entering the label text, create a div for the label text, then populate that div by setting the innerHTML property of the div through one of the many available Javascript events.

                        So for the label enter something like :

                        <div id="label_1"></div>

                        Now through any applicable Javascript event enter:

                        $('label_1').innerHTML='My New Label';
                        I am using this technique to change field labels but have not found a way to initialize them during the onDetailViewRender Event.

                        Need to have the defaults labels displayed during the initial render until changed.

                        Row label for First Name is
                        <div id="FNLABEL1"></div>
                        paried with
                        e._setElement.FNLABEL1.value = ("First Name")

                        <div id="{grid.componentname}.FNLABEL1"></div>
                        paried with
                        e._setGridElement.FNLABEL1.value = "First Name"

                        Tried both of these in onDetailViewRender Event

                        e._setGridElement.FNLABEL1.value = "First Name"
                        e._setElement.FNLABEL1.value = ("First Name")

                        Any suggestions where and with what code.

                        Thanks
                        Ralph

                        Comment


                          #13
                          Re: Grid Detail Column Heading JS syntax

                          Here's a video describing the technique I outlined earlier.

                          http://www.screencast.com/t/YmMxMzFkNzA
                          Bob Moore


                          Comment


                            #14
                            Re: Grid Detail Column Heading JS syntax

                            Originally posted by Peter.Greulich View Post
                            No. I use it in a watch event.
                            Peter:
                            Did you get your Radio Button to work in the Detail view's watch event?

                            Comment


                              #15
                              Re: Grid Detail Column Heading JS syntax

                              Originally posted by Peter.Greulich View Post
                              No. I use it in a watch event.
                              Attached are 3 PNGs that show a radio button, in a Detail View, being used to change field labels to match user's language selection. Since I am using a Radio Button their selection is stored in this record, so when they visit this gird the labels change to match their selected language.
                              The A5 language process requires a grid refresh and would increase server traffic, which defeats some of the purpose of using Ajax.
                              My grid in this app. is unfortunately very large.
                              I haven't figured how to change button and tab text. But this is a start.
                              You can see in the PNG's the record # increment and the labels dynamically change.
                              Last edited by graycoder63; 02-10-2010, 10:21 PM.

                              Comment

                              Working...
                              X