how we can apply pagination on grid layout

i wanted to apply pagination on grid layout, can we do that?

Parents
  • Hi Lokesh,

    Grid Layout don't allow to add pagingInfo in it but there is a workaround for it.
    You can user richtextfileds and dynamical links to achieve this.

    Please go through below code, add this after your gridLayout Code.

    a!richTextDisplayField(
    value: {
    a!richTextItem_18r1(
    text: "<",
    link: a!dynamicLink(
    saveInto: {
    a!save(
    ri!pagingInfo.startIndex,
    ri!pagingInfo.startIndex-ri!pagingInfo.batchSize)

    }
    ),
    showWhen: not(
    ri!pagingInfo.startIndex <= 1
    )
    ),
    " ",
    if(
    ri!data.totalCount > 0,
    {
    ri!pagingInfo.startIndex,
    " - "
    },
    ""
    ),
    if(
    ri!pagingInfo.startIndex + ri!pagingInfo.batchSize - 1 > ri!data.totalCount,
    ri!data.totalCount,
    ri!pagingInfo.startIndex + ri!pagingInfo.batchSize - 1
    ),
    if(
    ri!data.totalCount > 0,
    " of ",
    ""
    ),
    ri!data.totalCount,
    if(
    ri!data.totalCount > 0,
    " items ",
    ""
    ),
    a!richTextItem_18r1(
    text: ">",
    link: a!dynamicLink(
    saveInto: {
    a!save(
    ri!pagingInfo.startIndex,
    ri!pagingInfo.startIndex + ri!pagingInfo.batchSize
    )
    }
    ),
    showWhen: (
    ri!data.totalCount >= ri!pagingInfo.startIndex + ri!pagingInfo.batchSize
    )
    )
    },
    align: "RIGHT"
    )
Reply
  • Hi Lokesh,

    Grid Layout don't allow to add pagingInfo in it but there is a workaround for it.
    You can user richtextfileds and dynamical links to achieve this.

    Please go through below code, add this after your gridLayout Code.

    a!richTextDisplayField(
    value: {
    a!richTextItem_18r1(
    text: "<",
    link: a!dynamicLink(
    saveInto: {
    a!save(
    ri!pagingInfo.startIndex,
    ri!pagingInfo.startIndex-ri!pagingInfo.batchSize)

    }
    ),
    showWhen: not(
    ri!pagingInfo.startIndex <= 1
    )
    ),
    " ",
    if(
    ri!data.totalCount > 0,
    {
    ri!pagingInfo.startIndex,
    " - "
    },
    ""
    ),
    if(
    ri!pagingInfo.startIndex + ri!pagingInfo.batchSize - 1 > ri!data.totalCount,
    ri!data.totalCount,
    ri!pagingInfo.startIndex + ri!pagingInfo.batchSize - 1
    ),
    if(
    ri!data.totalCount > 0,
    " of ",
    ""
    ),
    ri!data.totalCount,
    if(
    ri!data.totalCount > 0,
    " items ",
    ""
    ),
    a!richTextItem_18r1(
    text: ">",
    link: a!dynamicLink(
    saveInto: {
    a!save(
    ri!pagingInfo.startIndex,
    ri!pagingInfo.startIndex + ri!pagingInfo.batchSize
    )
    }
    ),
    showWhen: (
    ri!data.totalCount >= ri!pagingInfo.startIndex + ri!pagingInfo.batchSize
    )
    )
    },
    align: "RIGHT"
    )
Children

 Discussion posts and replies are publicly visible