Is there anything similar to a!pagingInfo (used for pagination in a!gridField)

Is there anything similar to a!pagingInfo (used for pagination in a!gridField) which can be applied for applying pagination for an editable grid(constructed by a!gridLayout)....

OriginalPostID-128158

OriginalPostID-128158

  Discussion posts and replies are publicly visible

Parents
  • We have successfully implemented paging with an editable grid by setting up a button bar with the paging controls. Clicking the button will update the PagingInfo load() variable and then reload the data into another load(). Unlike a GridField, you do not query inside a with(), because you need to be able to save into something to make edits -- instead you query the data on paging button saveInto. A psuedocode example:

     load(
       local!pagingInfo: a!pagingInfo(1,10,a!sortInfo("lineNumber", true)),
       local!data: rule!getData(local!pagingInfo),
       {
         gridLayout(
         ...
         ),
         a!buttonLayout(
           secondaryButtons: {
             a!buttonWidget(label: "First", saveInto: {
               a!save(local!pagingInfo.startIndex, 1),
               a!save(local!data, rule!getData(local!pagingInfo))
             }),
             a!buttonWidget(label: "Next", saveInto: {
               a!save(local!pagingInfo.startIndex, local!pagingInfo.startIndex+batchSize),
               a!save(local!data, rule!getData(local!pagingInfo))
             }),
             ...
    

    There can be a confusing interaction if the user clicks a paging control while having unsaved changes on the screen, so you can mitigate this by either disabling the buttons when unsaved changes are detected, or use a button confirmation message.

Reply
  • We have successfully implemented paging with an editable grid by setting up a button bar with the paging controls. Clicking the button will update the PagingInfo load() variable and then reload the data into another load(). Unlike a GridField, you do not query inside a with(), because you need to be able to save into something to make edits -- instead you query the data on paging button saveInto. A psuedocode example:

     load(
       local!pagingInfo: a!pagingInfo(1,10,a!sortInfo("lineNumber", true)),
       local!data: rule!getData(local!pagingInfo),
       {
         gridLayout(
         ...
         ),
         a!buttonLayout(
           secondaryButtons: {
             a!buttonWidget(label: "First", saveInto: {
               a!save(local!pagingInfo.startIndex, 1),
               a!save(local!data, rule!getData(local!pagingInfo))
             }),
             a!buttonWidget(label: "Next", saveInto: {
               a!save(local!pagingInfo.startIndex, local!pagingInfo.startIndex+batchSize),
               a!save(local!data, rule!getData(local!pagingInfo))
             }),
             ...
    

    There can be a confusing interaction if the user clicks a paging control while having unsaved changes on the screen, so you can mitigate this by either disabling the buttons when unsaved changes are detected, or use a button confirmation message.

Children
No Data