Duke3D
Member
I'm circling back on this topic as I think the data is available / already rendered and just needs to be accessed. I suspect I didn't ask my question very clearly so I'm trying again.
Starting at a List View, a user-selected sort is active (column headings are clicked), pages have been turned and the Edit button for a specific record is now being clicked.
At that moment, a query has already retrieved an array of records to display, applied joins and sort criteria, broken into page-long ranges, and we can parse the data in the specific record that was clicked. This info remains available for reuse when the Form is closed via Save or Cancel, the List is redisplayed with the same sort in effect, same page selected, and possibly the same offset tagged as active.
How can I access / extract / store / pass both the array of sorted record IDs and the index of the selected record to the Form View so that controls added to that template can jump to the Next or Previous record in the array while remaining in Form View?
$id=$sortedListArray[$currentIndex+1] or $id=$sortedListArray[$currentIndex-1]
(trap index < 0 and > array.length-1)
Is there a fabrik variable that already has this active array for the currently displayed sorted List? It seems the index within that array can be picked up from the button instance that is clicked.
Conceptually this seems vary straight forward. I just don't know how to accomplish it in the Fabrik context without requerying and reapplying all the user sort preferences. It seems it should be simpler than reinventing the wheel and re-executing the active queries all over again. Is there an object or variable I can latch onto that preserves and could pass on the active array of record ID's?
If, in fact, I need to re-run the queries, how to I apply the same sort criteria as the current List View. Is the sort phrase in a fabrik object or variable?
I can't be the first person looking to implement some form of paging / record traversal in Form View. (My PHP-foo is weak so specific code examples or links to tutorials are appreciated.)
/D
Starting at a List View, a user-selected sort is active (column headings are clicked), pages have been turned and the Edit button for a specific record is now being clicked.
At that moment, a query has already retrieved an array of records to display, applied joins and sort criteria, broken into page-long ranges, and we can parse the data in the specific record that was clicked. This info remains available for reuse when the Form is closed via Save or Cancel, the List is redisplayed with the same sort in effect, same page selected, and possibly the same offset tagged as active.
How can I access / extract / store / pass both the array of sorted record IDs and the index of the selected record to the Form View so that controls added to that template can jump to the Next or Previous record in the array while remaining in Form View?
$id=$sortedListArray[$currentIndex+1] or $id=$sortedListArray[$currentIndex-1]
(trap index < 0 and > array.length-1)
Is there a fabrik variable that already has this active array for the currently displayed sorted List? It seems the index within that array can be picked up from the button instance that is clicked.
Conceptually this seems vary straight forward. I just don't know how to accomplish it in the Fabrik context without requerying and reapplying all the user sort preferences. It seems it should be simpler than reinventing the wheel and re-executing the active queries all over again. Is there an object or variable I can latch onto that preserves and could pass on the active array of record ID's?
If, in fact, I need to re-run the queries, how to I apply the same sort criteria as the current List View. Is the sort phrase in a fabrik object or variable?
I can't be the first person looking to implement some form of paging / record traversal in Form View. (My PHP-foo is weak so specific code examples or links to tutorials are appreciated.)
/D
Last edited: