<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.appian.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>How to apply Pagination on  cardLayouts</title><link>https://community.appian.com/discussions/f/user-interface/13650/how-to-apply-pagination-on-cardlayouts</link><description>instead of using gridField, we are using cardLayouts to display data for better look and feel , but wanted to know how we can apply custom pagination and sorting on these cardLayouts.</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: How to apply Pagination on  cardLayouts</title><link>https://community.appian.com/thread/62430?ContentTypeID=1</link><pubDate>Thu, 08 Nov 2018 18:56:29 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:1b69bc84-71a6-46d6-9ad2-f7393b7aa6b2</guid><dc:creator>Vincent Mark</dc:creator><description>&lt;p&gt;&lt;a href="/members/lokeshk0001"&gt;Lokesh Kothari&lt;/a&gt;&amp;nbsp;Yes, it is possible but not fun and requires you to manually set up pagination on your data. Fortunately I wrote up a simple sample code for you. The pagination UI is near identical to Appian&amp;#39;s out of the box paging grids, however the sort options are a little different. I hope this helps!&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="/cfs-file/__key/communityserver-discussions-components-files/13/pastedimage1541706989000v1.png"&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/13/pastedimage1541706989000v1.png" alt=" " /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;load(
  local!data: {
    {
      id: 1,
      name: &amp;quot;John&amp;quot;,
      value: &amp;quot;your value here!&amp;quot;
    },
    {
      id: 2,
      name: &amp;quot;Mary&amp;quot;,
      value: &amp;quot;your value here!&amp;quot;
    },
    {
      id: 3,
      name: &amp;quot;Ben&amp;quot;,
      value: &amp;quot;your value here!&amp;quot;
    },
    {
      id: 4,
      name: &amp;quot;Ryan&amp;quot;,
      value: &amp;quot;your value here!&amp;quot;
    },
    {
      id: 5,
      name: &amp;quot;Amy&amp;quot;,
      value: &amp;quot;your value here!&amp;quot;
    },
    {
      id: 6,
      name: &amp;quot;Jennifer&amp;quot;,
      value: &amp;quot;your value here!&amp;quot;
    },
    {
      id: 7,
      name: &amp;quot;Joe&amp;quot;,
      value: &amp;quot;your value here!&amp;quot;
    },
    {
      id: 8,
      name: &amp;quot;Melissa&amp;quot;,
      value: &amp;quot;your value here!&amp;quot;
    },
    {
      id: 9,
      name: &amp;quot;Anthony&amp;quot;,
      value: &amp;quot;your value here!&amp;quot;
    }
  },
  local!pagingInfo: a!pagingInfo(
    startIndex: 1,
    batchSize: 3,
    sort: a!sortInfo(
      field: &amp;quot;id&amp;quot;,
      ascending: true
    )
  ),
  with(
    local!datasubset: todatasubset(
      local!data,
      local!pagingInfo
    ),
    local!dataForCurrentPage: local!datasubset.data,
    {
      a!sectionLayout(
        contents: {
          a!boxLayout(
            label: &amp;quot;Sort&amp;quot;,
            contents: {
              a!columnsLayout(
                columns: {
                  a!columnLayout(
                    contents: {
                      a!dropdownField(
                        label: &amp;quot;Field&amp;quot;,
                        choiceLabels: {
                          &amp;quot;ID&amp;quot;,
                          &amp;quot;Name&amp;quot;,
                          &amp;quot;Value&amp;quot;
                        },
                        choiceValues: {
                          &amp;quot;id&amp;quot;,
                          &amp;quot;name&amp;quot;,
                          &amp;quot;value&amp;quot;
                        },
                        value: local!pagingInfo.sort.field,
                        saveInto: {
                          local!pagingInfo.sort.field,
                          a!save(
                            local!pagingInfo.startIndex,
                            1
                          )
                        }
                      )
                    }
                  ),
                  a!columnLayout(
                    contents: {
                      a!radioButtonField(
                        label: &amp;quot;Order&amp;quot;,
                        choiceLabels: {
                          &amp;quot;Ascending&amp;quot;,
                          &amp;quot;Descending&amp;quot;
                        },
                        choiceValues: {
                          true,
                          false
                        },
                        choiceLayout: &amp;quot;COMPACT&amp;quot;,
                        value: local!pagingInfo.sort.ascending,
                        saveInto: {
                          local!pagingInfo.sort.ascending,
                          a!save(
                            local!pagingInfo.startIndex,
                            1
                          )
                        }
                      )
                    }
                  )
                }
              )
            }
          )
        }
      ),
      a!sectionLayout(
        contents: {
          a!forEach(
            items: local!dataForCurrentPage,
            expression: a!cardLayout(
              style: &amp;quot;STANDARD&amp;quot;,
              contents: {
                a!columnsLayout(
                  columns: {
                    a!columnLayout(
                      contents: {
                        a!textField(
                          label: &amp;quot;ID&amp;quot;,
                          readOnly: true,
                          value: property(
                            fv!item,
                            &amp;quot;id&amp;quot;
                          )
                        )
                      },
                      width: &amp;quot;NARROW&amp;quot;
                    ),
                    a!columnLayout(
                      contents: {
                        a!textField(
                          label: &amp;quot;Name&amp;quot;,
                          readOnly: true,
                          value: property(
                            fv!item,
                            &amp;quot;name&amp;quot;
                          )
                        )
                      }
                    ),
                    a!columnLayout(
                      contents: {
                        a!textField(
                          label: &amp;quot;Some value&amp;quot;,
                          readOnly: true,
                          value: property(
                            fv!item,
                            &amp;quot;value&amp;quot;
                          )
                        )
                      }
                    )
                  }
                )
              }
            )
          ),
          
        }
      ),
      a!sectionLayout(
        contents: {
          a!richTextDisplayField(
            align: &amp;quot;RIGHT&amp;quot;,
            value: {
              a!richTextIcon(
                icon: &amp;quot;chevron-left&amp;quot;,
                link: a!dynamicLink(
                  saveInto: a!save(
                    local!pagingInfo,
                    a!pagingInfo(
                      startIndex: local!pagingInfo.startIndex - local!pagingInfo.batchSize,
                      batchSize: local!pagingInfo.batchSize,
                      sort: local!pagingInfo.sort
                    )
                  ),
                  showWhen: local!pagingInfo.startIndex &amp;gt; 1
                ),
                linkStyle: &amp;quot;STANDALONE&amp;quot;
              ),
              a!richTextItem(
                text: {
                  char(
                    32
                  ),
                  a!richTextItem(
                    text: {
                      joinarray(
                        {
                          property(
                            local!pagingInfo,
                            &amp;quot;startIndex&amp;quot;
                          ),
                          char(
                            45
                          ),
                          property(
                            local!pagingInfo,
                            &amp;quot;startIndex&amp;quot;
                          ) + property(
                            local!pagingInfo,
                            &amp;quot;batchSize&amp;quot;
                          ) - 1
                        },
                        char(
                          32
                        )
                      )
                    },
                    style: &amp;quot;STRONG&amp;quot;
                  ),
                  char(
                    32
                  ),
                  joinarray(
                    {
                      &amp;quot;of&amp;quot;,
                      count(
                        local!data
                      )
                    },
                    char(
                      32
                    )
                  ),
                  char(
                    32
                  )
                }
              ),
              a!richTextIcon(
                icon: &amp;quot;chevron-right&amp;quot;,
                link: a!dynamicLink(
                  saveInto: a!save(
                    local!pagingInfo,
                    a!pagingInfo(
                      startIndex: local!pagingInfo.startIndex + local!pagingInfo.batchSize,
                      batchSize: local!pagingInfo.batchSize,
                      sort: local!pagingInfo.sort
                    )
                  ),
                  showWhen: local!pagingInfo.startIndex &amp;lt; count(
                    local!data
                  ) - local!pagingInfo.batchSize
                ),
                linkStyle: &amp;quot;STANDALONE&amp;quot;
              )
            }
          )
        }
      )
    }
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to apply Pagination on  cardLayouts</title><link>https://community.appian.com/thread/62034?ContentTypeID=1</link><pubDate>Mon, 29 Oct 2018 17:01:05 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:cbeff962-be47-40ac-b6c5-cc6963b64b0f</guid><dc:creator>Andrew Zysk</dc:creator><description>Setting selectionStyle as &amp;quot;ROW_HIGHLIGHT&amp;quot; could also be useful to get the desired look.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to apply Pagination on  cardLayouts</title><link>https://community.appian.com/thread/62002?ContentTypeID=1</link><pubDate>Mon, 29 Oct 2018 09:46:59 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:fd59a035-9cb4-4442-b230-95167208ae3e</guid><dc:creator>PhilB</dc:creator><description>Have you tried playing with the spacing, borderStyle, shadeAlternateRows or selectionStyle to achieve this look with a conventional paging grid? Specifically, using borderStyle: &amp;quot;LIGHT&amp;quot; comes very close to the look in your screenshot.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to apply Pagination on  cardLayouts</title><link>https://community.appian.com/thread/61987?ContentTypeID=1</link><pubDate>Sun, 28 Oct 2018 10:20:42 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:69a90054-f8cf-4556-a33d-4845fe29fe07</guid><dc:creator>chandu</dc:creator><description>At this point of time its a little bit complex in implementing the column sort like how you expect in the grid field, may be you can have a drop down sort by:column and type asc or desc, then change the data accordingly.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to apply Pagination on  cardLayouts</title><link>https://community.appian.com/thread/61985?ContentTypeID=1</link><pubDate>Sun, 28 Oct 2018 07:29:20 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c65198c8-93ac-456e-a954-2bef2027df6e</guid><dc:creator>Lokesh Kothari</dc:creator><description>what about column sorting&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to apply Pagination on  cardLayouts</title><link>https://community.appian.com/thread/61981?ContentTypeID=1</link><pubDate>Sat, 27 Oct 2018 16:33:22 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:e11e1e52-8f15-40c8-ac8d-2b8ecd4c98ec</guid><dc:creator>chandu</dc:creator><description>Hi Lokesh Kothari,&lt;br /&gt;
&lt;br /&gt;
High level we can try it out with the following way.&lt;br /&gt;
&lt;br /&gt;
Design a generic card layout that takes the your details and displays within it.&lt;br /&gt;
Design one interface and user forEach to display first the generic card layout interface.&lt;br /&gt;
Below you try to use  a!richTextIcon with the combination of dynamic link to change the pagination for this you need create an expression rule that handles the &amp;quot;&amp;lt;&amp;lt;&amp;quot;,  &amp;quot;&amp;lt;&amp;quot;   &amp;quot;&amp;gt;&amp;quot; &amp;quot; &amp;gt;&amp;gt;&amp;quot;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>