I want to have a subfile with column sorting capability.
Subfile sorting only sorts the records loaded into the subfile at the time you click the sort. That makes sense. so I need to load the entire subfile in order for sorting to work effectively. Or pass the column sort response fields back to the server... which I'd rather not do because it's a lot more work.
If I load the whole subfile it will be more than 9999 rows, so I need to use a database driven subfile grid.
However, I can't tell how to return to the RPG program the record or records that the user selects. Since the subfile is built on the client side, the server isn't aware of record numbers or what's loaded into them. so I will need to return all of the fields of the selected record(s).
Is this possible? And does someone have an example of how to do this?
subfile sorting & data driven subfile
-
- New User
- Posts: 2
- Joined: Tue Oct 01, 2013 12:55 pm
- First Name: Karl
- Last Name: Abbott
- Company Name: Abbott Consulting Services
- Phone: 8582681224
- Address 1: 10877 Montego Drive
- City: San Diego
- State / Province: California
- Zip / Postal Code: 92124
- Country: United States
- Contact:
-
- Experienced User
- Posts: 2711
- Joined: Wed Aug 01, 2012 8:58 am
- First Name: Scott
- Last Name: Klement
- Company Name: Profound Logic
- City: Milwaukee
- State / Province: Wisconsin
Re: subfile sorting & data driven subfile
You can't return data from the database-driven subfile to an RPG program. It can't work because the RPG program doesn't have the fields, etc, in the record format and the data isn't in the OA handler, it's just loaded onto the screen directly from the database. (and, even if you did make this readable from RPG, that would re-impose the 9999 limit.)
I would suggest using the column sort response.
I would suggest using the column sort response.
- Brian
- Profound Logic Staff Member
- Posts: 286
- Joined: Thu Apr 14, 2011 10:23 am
- First Name: Brian
- Last Name: May
- Company Name: Profound Logic Software
- Contact:
Re: subfile sorting & data driven subfile
It could be done by having hidden fields in the control record format for the key fields needed from the grid. You would need to use some custom javascript on the onrowclick or onrowdblclick event of the grid to retrieve the data from the row and populate the hidden fields. This of course would only work for selecting a single row. If this sounds like a viable solution for you, I can look around for an example.
-
- New User
- Posts: 12
- Joined: Mon Dec 19, 2016 12:25 pm
- First Name: paul
- Last Name: kenosky
- Company Name: keystone auto
- State / Province: Pennsylvania
- Contact:
Re: subfile sorting & data driven subfile
This is something I am currently trying to do... Is this possible?Brian wrote:It could be done by having hidden fields in the control record format for the key fields needed from the grid. You would need to use some custom javascript on the onrowclick or onrowdblclick event of the grid to retrieve the data from the row and populate the hidden fields. This of course would only work for selecting a single row. If this sounds like a viable solution for you, I can look around for an example.
Do you have an example of the javascript code that would need to go in onrowclick?
-
- New User
- Posts: 12
- Joined: Mon Dec 19, 2016 12:25 pm
- First Name: paul
- Last Name: kenosky
- Company Name: keystone auto
- State / Province: Pennsylvania
- Contact:
Re: subfile sorting & data driven subfile
Believe I found what I was looking for on another post "Database-Driven Subfile Cell Access"
changeElementValue("TextBox1", getObj("Grid1").grid.getCellValue(row,0));
pressKey("enter");
changeElementValue("TextBox1", getObj("Grid1").grid.getCellValue(row,0));
pressKey("enter");
Who is online
Users browsing this forum: No registered users and 4 guests