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

e.rowData.data("fieldName") Doesn't Work

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

    e.rowData.data("fieldName") Doesn't Work

    I'm having no success attempting to use e.rowData.data("fieldName") to retrieve the value of a row's field in a grid.

    In the OnExpandRow Server-side event I have the following:

    e.html = Matching_Itineraries(e.rowData.data("Itinerary_id")) 'Matching_Itineraries() is a UDF. Itinerary_id is the name of the read only row field who's numeric value I need to retrieve for the UDF

    This produces the following error on expanding the row:

    Error executing OnRowExpand event handler: command: e.html = Matching_Itineraries(e.rowData.data("Itinerary_id")) Property not found
    e.rowData subelement not found.

    which implies e.rowData doesn't exist. How do I retrieve the value of Itinerary_id from the row that's being expanded?

    [Note that a simple test of e.html = Matching_Itineraries(2) produces the expected result]

    #2
    Re: e.rowData.data("fieldName") Doesn't Work

    Code:
    function OnExpandRow as v (e as p)
    'NOTE: This event ONLY fires if you have set the 'Row expander type' to 'CustomEvent'.
    
    'This event must set the e.html and e.javascript properties. The contents of the expanded row will be set to e.html.
    'In addition, if e.javascript is not null, the javascript contained in this property will be executed.
    'e.rowNumber - row number of the row that was expanded (numeric value)
    'e.primaryKeyValuesArray - an array of the primary key values for the row that was expanded.
    'e.tmpl - component definition
    'e.rv - Request Variables (allows you to get at page variables and session variables - e.g. e.rv.var1, e.rv.session.sessionvar1) 
    'e.rv.Session - session variables. TIP: To set a session variable: e.rv.Session.myNewSessionVariable = "Alpha"
    'Note - all values in this array are character values, even if the corresponding primary key column is of a different type
    
    'Example:
    'e.html = "this text will be inserted in the row when it is expanded"
    'e.javascript = "alert('Row was expanded');"
    
    
    end function
    I dont think e.rowData is valid in this function?
    Last edited by Keith Hubert; 09-25-2011, 04:15 AM.
    Regards
    Keith Hubert
    Alpha Guild Member
    London.
    KHDB Management Systems
    Skype = keith.hubert


    For your day-to-day Needs, you Need an Alpha Database!

    Comment


      #3
      Re: e.rowData.data("fieldName") Doesn't Work

      Chris - in practical terms what is it you are trying to do with this process? - Happy to help.
      Insanity: doing the same thing over and over again and expecting different results.
      Albert Einstein, (attributed)
      US (German-born) physicist (1879 - 1955)

      Comment


        #4
        Re: e.rowData.data("fieldName") Doesn't Work

        Originally posted by CJMcGrath View Post
        which implies e.rowData doesn't exist. How do I retrieve the value of Itinerary_id from the row that's being expanded?
        If you put a debug(1) into OnExpandRow event and check it in Working Preview, you will see that there is no e.rowData object available (as Keith has suggested).
        Peter
        AlphaBase Solutions, LLC

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


        Comment


          #5
          Re: e.rowData.data("fieldName") Doesn't Work

          You could use
          Code:
          e.primaryKeyValuesArray(1)
          if Itinerary_id is a primary key. Alternately you could do a sql_lookup and get the data you want by using the primary key.
          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


            #6
            Re: e.rowData.data("fieldName") Doesn't Work

            Keith & Peter Greulich, yes, I figured that. So what can I use to feed data from a field in the row being expanded to a UDF in the OnExpandRow function?

            Frank, e.html = Matching_Itineraries(e.primaryKeyValuesArray(1)) produces a similar error when Working Preview compiles the grid:

            Error executing OnRowExpand event handler: command: e.html = Matching_Itineraries(e.primaryKeyValuesArray(1)) Property not found
            e.primaryKeyValuesArray method not found.

            so e.primaryKeyValuesArray is not available to the OnExpandRow function either. (I'm working with DBF tables at the moment. The field "Itinerary_Id" that I am trying to access is an indexed field in this table).

            Pete Conway, my UDF "FUNCTION Matching_Itineraries AS C (Itinerary_Id AS N )" produces an HTML table based on the Itinerary_Id field of the row being expanded.

            What use can the OnExpandRow function be if it can't produce customised html for e.html or javascript for e.javascript based on the row's contents because no mechanism has been provided for OnExpandRow to read the row's fields? Is it javascript code that is used to grab field data from the row? Has anyone written a CustomEvent for a Row Expander, as they must have found a way for the CustomEvent to act specifically on the row's contents?

            Comment


              #7
              Re: e.rowData.data("fieldName") Doesn't Work

              Hi Chris,

              When you click on the Row Expander, apart from opening a filtered grid, exactly what else do you want to happen?
              Regards
              Keith Hubert
              Alpha Guild Member
              London.
              KHDB Management Systems
              Skype = keith.hubert


              For your day-to-day Needs, you Need an Alpha Database!

              Comment


                #8
                Re: e.rowData.data("fieldName") Doesn't Work

                Sorry, the syntax is e.primaryKeyValuesArray[1]

                The correct statement would be:

                MyPrimaryKeyVariable = e.primaryKeyValuesArray[1]
                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


                  #9
                  Re: e.rowData.data("fieldName") Doesn't Work

                  Hi Keith,
                  The Row Expander does not open a Linked Grid as the filter conditions and required response seemed a bit too complex, so I decided to write an Xbasic function to work directly with the tables. On the Grid Properties panel, the Row Expander Type is set to CustomEvent enabling the OnExpandRow Server-side Event. The OnExpandRow function executes my UDF (Matching_Itineraries) assigning the product to e.html (my UDF produces an HTML table that appears in the Row Expander space instead of a Linked Grid). It works fine except the variable the UDF needs to produce the correct table comes from a field (Itinerary_id) in the expanded row, and I don't know the correct syntax to pass that variable to the UDF.

                  Hi Frank,
                  e.html = Matching_Itineraries(e.primaryKeyValuesArray[1]) produces a variable type error, so I tried:

                  e.html = Matching_Itineraries(convert_type(e.primaryKeyValuesArray[1], "n")) 'because Itinerary_id is a number

                  The UDF fired but returned the wrong information. On checking with debug(1) it turns out none of the e.primaryKeyValuesArray values [1...4] is the value of the Itinerary_id field in this row. (The Itinerary_id is the first index of the Itinerary table (which is the primary Table in View) and the second field of the row). e.primaryKeyValuesArray does not include the Itinerary_id field value. What is the information contained in e.primaryKeyValuesArray? Can it be told to include a specified field?

                  Comment


                    #10
                    Re: e.rowData.data("fieldName") Doesn't Work

                    Hi Chris,
                    The Row Expander does not open a Linked Grid as the filter conditions and required response seemed a bit too complex
                    Even if you do get your code to work, I dont think you can make the returned data to display any faster than the expanded grid.
                    Regards
                    Keith Hubert
                    Alpha Guild Member
                    London.
                    KHDB Management Systems
                    Skype = keith.hubert


                    For your day-to-day Needs, you Need an Alpha Database!

                    Comment


                      #11
                      Re: e.rowData.data("fieldName") Doesn't Work

                      Hi Keith,
                      Although writing a UDF for the OnRowExpand CustomEvent seemed like the easier approach for me (an Alpha novice), it can't be made to work as Alpha does not support the e.rowData object or similar for OnRowExpand to pass data to the UDF :-(

                      So back to filtering a Linked Grid...
                      How do I establish and pass values from the expanded row's fields to the Linked Grid's filter? (For example, in this case, how do I pass the value of the Itinerary_id field from the expanded row to the Linked Grid's filter?). I guess I must establish a session variable somewhere in the parent grid to carry the value to the filter, but where?

                      Is there a tutorial on filtering Row Expander Linked Grids?
                      Last edited by CJMcGrath; 09-26-2011, 05:59 PM.

                      Comment


                        #12
                        Re: e.rowData.data("fieldName") Doesn't Work

                        Originally posted by CJMcGrath View Post
                        Hi Keith,
                        Although writing a UDF for the OnRowExpand CustomEvent seemed like the easier approach for me (an Alpha novice), it can't be made to work as Alpha does not support the e.rowData object or similar for OnRowExpand to pass data to the UDF :-(
                        Chris,

                        Frank gave you the answer of how to get a value other than the primary key:

                        You could use Code: e.primaryKeyValuesArray(1) if Itinerary_id is a primary key. Alternately you could do a sql_lookup and get the data you want by using the primary key.
                        You just need to look at sql_lookup(). http://alphafivewiki.com/SQL_Lookup+Function Use the records primary key already available to you in e.primaryKeyValuesArray[] and pass that into the sql_lookup() function to return the value of the field you want to pass into your UDF.
                        Jim Coltz
                        Alpha Custom Database Solutions, LLC
                        A5CustomSolutions.com
                        [email protected]

                        Comment


                          #13
                          Re: e.rowData.data("fieldName") Doesn't Work

                          Hi Jim,
                          The table is a DBF, not SQL, which might be why this doesn't work? The field in question "Itinerary_id" is the first index of this table, which I assumed makes is a "primary key", (although I can't find any explanation anywhere of what e.primaryKeyValuesArray actually returns).

                          Using debug I can see the values of e.primaryKeyValuesArray
                          They are [1]=15,[2]=1,[3]=6,[4]=1. The value of Itinerary_id in this row is 10, therefore I've concluded I can't access this field's value using e.primaryKeyValuesArray.

                          Comment


                            #14
                            Re: e.rowData.data("fieldName") Doesn't Work

                            Originally posted by CJMcGrath View Post
                            The table is a DBF, not SQL, which might be why this doesn't work? The field in question "Itinerary_id" is the first index of this table, which I assumed makes is a "primary key", (although I can't find any explanation anywhere of what e.primaryKeyValuesArray actually returns).
                            You can set the grid's primary key in the grid's query tab.
                            Peter
                            AlphaBase Solutions, LLC

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


                            Comment


                              #15
                              Re: e.rowData.data("fieldName") Doesn't Work

                              Jim,

                              If you have the primary key and have that as a foreign key in another table you can do a sql_lookup and return any data you need. You could do a call to a sql procedure as well. But to Keith's point speed an sequence of operation may be an obstacle. I think there was a thread earlier that discussed ways to accomplish what you want but I don't remember when. If you search on 'linked grids' or 'row expander' you should find it.
                              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

                              Working...
                              X