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

  • 0
    Certified Lead Developer
    editable grid does not support pagination
  • 0
    Certified Lead Developer
    If you can't using a!pagingInfo on the query you use to retrieve your data you can call todatasubset() on your data with a!pagingInfo and pass your paged data to the editable grid. If you reference forum.appian.com/.../SAIL_Recipes.html you should just be able to replace the local!items variable with your paged query or datasubset.
  • HI , i am having issue in sorting the grid data,can you please let me know where is my below code wrong.

    load(
    local!showMine: true,
    local!showFuture: true,
    local!pagingInfo: a!pagingInfo(
    startIndex: 1,
    batchSize: 10,
    sort: a!sortInfo(
    field: "taskId_int",
    ascending: false
    )
    ),
    local!user: loggedinuser(),
    local!loggedInUsersGroups: getgroupsformemberuser(
    local!user
    ),
    local!filterStartDate,
    local!filterEndDate,
    local!filterPreparerGroup,
    local!filterProject: index(
    rule!CCAR_QE_getKeyValuePairForHandoffFilters(
    pagingInfo: a!pagingInfo(
    startIndex: 1,
    batchSize: -1,
    sort: a!sortInfo(
    field: "projectId_int",
    ascending: false
    )
    ),
    user: loggedInUser(),
    showMine: local!showMine,
    showFuture: local!showFuture,
    returnDatasubset: false,
    keyGroupingField: "projectId_int",
    valueGroupingField: "projectName_txt"
    ),
    "projectId_int",
    null
    ),
    local!filterPhase,
    with(
    local!phaseOptions_cdt: if(
    isnull(
    local!filterProject
    ),
    null,
    rule!CCAR_QE_getPhaseByProjectId(
    pagingInfo: null,
    projectId_int: local!filterProject
    )
    ),
    local!resetPagingInfo: a!save(
    local!pagingInfo,
    a!pagingInfo(
    startIndex: 1,
    batchSize: 10,
    sort: a!sortInfo(
    field: "taskId_int",
    ascending: true
    )
    )
    ),
    local!resetFilters: a!save(
    {
    local!filterStartDate,
    local!filterEndDate,
    local!filterPreparerGroup,
    local!filterProject,
    local!filterPhase
    },
    null
    ),
    local!gridDatasubset: rule!CCAR_QE_getAcceptanceReportData(
    pagingInfo: local!pagingInfo,
    user: loggedInUser(),
    showMine: local!showMine,
    showFuture: local!showFuture,
    filterProject: local!filterProject,
    filterPhase: local!filterphase,
    filterStartDate: local!filterStartDate,
    filterEndDate: local!filterEndDate,
    filterPreparerGroup: local!filterPreparerGroup,
    removeStatusId: {
    cons!CCAR_VAL_STATUS_RESTARTED
    }
    ),
    /* project dropdown options */
    local!projectKeyValueDatasubset: rule!CCAR_QE_getKeyValuePairForHandoffFilters(
    pagingInfo: null,
    user: local!user,
    showMine: local!showMine,
    showFuture: local!showFuture,
    returnDatasubset: true,
    keyGroupingField: "projectId_int",
    valueGroupingField: "projectName_txt",
    /*filterStartDate: local!filterStartDate,*/
    /*filterEndDate: local!filterEndDate,*/
    /*filterPreparerGroup: local!filterPreparerGroup,*/
    usersGroups: local!loggedInUsersGroups
    ),
    local!allSyncUniqueProjectNames: index(
    local!projectKeyValueDatasubset.data,
    "projectName_txt",
    {}
    ),
    local!allSyncUniqueProjectId: index(
    local!projectKeyValueDatasubset.data,
    "projectId_int",
    {}
    ),
    /* phase dropdown options */
    /*local!phaseKeyValueDatasubset: rule!CCAR_QE_getKeyValuePairForHandoffFilters(*/
    /*pagingInfo: null,*/
    /*user: local!user,*/
    /*showMine: local!showMine,*/
    /*showFuture: local!showFuture,*/
    /*returnDatasubset: true,*/
    /*keyGroupingField: "phaseId_int",*/
    /*valueGroupingField: "phaseName_txt",*/
    /*usersGroups: local!loggedInUsersGroups*/
    /*),*/
    /*local!allSyncUniquePhaseNames: index(*/
    /*local!phaseKeyValueDatasubset.data,*/
    /*"phaseName_txt",*/
    /*{}*/
    /*),*/
    /*local!allSyncUniquePhaseId: index(*/
    /*local!phaseKeyValueDatasubset.data,*/
    /*"phaseId_int",*/
    /*{}*/
    /*),*/
    /* Preparer Workstream dropdown options */
    local!preparerWorkstreamKeyValueDatasubset: rule!CCAR_QE_getKeyValuePairForHandoffFilters(
    pagingInfo: null,
    user: local!user,
    showMine: local!showMine,
    showFuture: local!showFuture,
    returnDatasubset: true,
    keyGroupingField: "taskOwnerGroup_int",
    valueGroupingField: "",
    /*filterStartDate: local!filterStartDate,*/
    /*filterEndDate: local!filterEndDate,*/
    usersGroups: local!loggedInUsersGroups
    ),
    local!allSyncUniquepreparerWorkstreamIds: index(
    local!preparerWorkstreamKeyValueDatasubset.data,
    "taskOwnerGroup_int",
    {}
    ),
    local!allSyncUniquepreparerWorkstreamIdNames: if(
    rule!APN_isBlank(
    local!allSyncUniquepreparerWorkstreamIds
    ),
    {},
    apply(
    rule!CCAR_UT_stripGroupPrefix(
    groupId_int: _
    ),
    local!allSyncUniquepreparerWorkstreamIds
    )
    ),
    a!dashboardLayoutColumns(
    columns: {
    a!columnLayout(
    contents: {
    a!buttonLayout(
    secondaryButtons: {
    a!buttonWidget(
    label: "Future",
    style: if(
    local!showFuture,
    "PRIMARY",
    "NORMAL"
    ),
    value: true,
    saveInto: {
    local!showFuture,
    local!resetPagingInfo,
    local!resetFilters
    }
    ),
    a!buttonWidget(
    label: "Received",
    style: if(
    local!showFuture,
    "NORMAL",
    "PRIMARY"
    ),
    value: false,
    saveInto: {
    local!showFuture,
    local!resetPagingInfo,
    local!resetFilters
    }
    )
    },
    primaryButtons: {
    a!buttonWidget(
    label: "My Handoffs",
    style: if(
    local!showMine,
    "PRIMARY",
    "NORMAL"
    ),
    value: true,
    saveInto: {
    local!showMine,
    local!resetPagingInfo,
    local!resetFilters
    }
    ),
    a!buttonWidget(
    label: "My Group Handoffs",
    style: if(
    local!showMine,
    "NORMAL",
    "PRIMARY"
    ),
    value: false,
    saveInto: {
    local!showMine,
    local!resetPagingInfo,
    local!resetFilters
    }
    )
    }
    ),
    a!sectionLayout_17r1(
    label: "Filters",
    isInitiallyCollapsed: false,
    isCollapsible: true,
    firstColumnContents: {
    rule!HSBC_dropdownField(
    label: "Project",
    choiceLabels: local!allSyncUniqueProjectNames,
    choiceValues: local!allSyncUniqueProjectId,
    placeholderLabel: "All",
    value: local!filterProject,
    saveInto: {
    local!filterProject,
    a!save(
    local!filterPhase,
    null
    ),
    local!resetPagingInfo,

    }
    ),
    rule!HSBC_dropdownField(
    label: "Phase",
    choiceLabels: index(
    local!phaseOptions_cdt,
    "shortName_txt",
    {}
    ),
    choiceValues: index(
    local!phaseOptions_cdt,
    "id_int",
    {}
    ),
    placeholderLabel: "All",
    value: local!filterPhase,
    saveInto: {
    local!filterPhase,
    local!resetPagingInfo,

    }
    ),
    if(
    local!showFuture,

    rule!CCAR_CP_fromToDateGrid(
    fromDate: local!filterStartDate,
    toDate: local!filterEndDate,
    fromAdditionalSaveInto:local!resetPagingInfo,
    toAdditionalSaveInto: local!resetPagingInfo
    ),
    rule!CCAR_CP_fromToDateGrid(
    dateLabel: "Actions Taken ",
    fromDate: local!filterStartDate,
    toDate: local!filterEndDate,
    readOnly: false,
    fromAdditionalSaveInto: local!resetPagingInfo,
    toAdditionalSaveInto: local!resetPagingInfo
    )
    )
    },
    secondColumnContents: {
    rule!HSBC_dropdownField(
    label: "Preparer Workstream",
    choiceLabels: local!allSyncUniquepreparerWorkstreamIdNames,
    choiceValues: local!allSyncUniquepreparerWorkstreamIds,
    placeholderLabel: "All",
    value: local!filterPreparerGroup,
    saveInto: {
    local!filterPreparerGroup,
    local!resetPagingInfo
    }
    ),
    a!linkField(
    align: "RIGHT",
    labelPosition: "COLLAPSED",
    links: a!dynamicLink(
    label: "Reset filters",
    saveInto: {
    local!resetFilters,
    local!resetPagingInfo
    }
    )
    )
    }
    ),
    rule!CCAR_GRID_acceptanceReport(
    pagingInfo: local!pagingInfo,
    datasubset: local!gridDatasubset,
    loggedInUsersGroups: local!loggedInUsersGroups,
    showFuture: local!showFuture,
    showMine: local!showMine
    )
    }
    )
    }
    )
    )
    )
  • 0
    Certified Lead Developer
    Hi we do not have bydefault(OOTB) paging option for Editable Grid, however we can achieve that by having our customized code.

    In fact i am also interested to know, why we do not have OOTB pagingInfo support for Editable Grid.
  • 0
    Certified Lead Developer
    Hi yagyadeepk,

    For now, we don't have pagination in Editable Grid. We can customize our code to get it.

    Can you check the below link:
    forum.appian.com/.../summary
  • Hi yagyadeep, as of current versions there is nothing available for gridLayout. Editable grids do not support pagination.
  • 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.