<?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>collapsible editable grid with selection check boxes</title><link>https://community.appian.com/discussions/f/user-interface/35497/collapsible-editable-grid-with-selection-check-boxes</link><description>hi I am trying to implement an editable grid , which should have collapsible rows 
 
 I am trying to avoid nested loops and wanted a check box option for all the rows . Any coding examples will help. Thank you</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: collapsible editable grid with selection check boxes</title><link>https://community.appian.com/thread/143006?ContentTypeID=1</link><pubDate>Fri, 22 Nov 2024 06:32:14 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:5ab1efb6-2f67-4cc3-8335-5acba1237b9d</guid><dc:creator>Konduru Chaitanya</dc:creator><description>&lt;p&gt;Paging Control&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;    a!richTextDisplayField(
      labelPosition: &amp;quot;COLLAPSED&amp;quot;,
      value: {
        a!richTextIcon(
          icon: &amp;quot;angle-left-bold&amp;quot;,
          link: a!dynamicLink(
            saveInto: {
              a!save(
                local!paging.startIndex,
                local!paging.startIndex - local!paging.batchSize
              )
            }
          ),
          linkstyle: &amp;quot;STANDALONE&amp;quot;,
          showWhen:local!paging.startIndex &amp;gt; local!paging.batchSize,
          color: if(
            local!paging.startIndex &amp;gt; local!paging.batchSize,
            &amp;quot;ACCENT&amp;quot;,
            &amp;quot;SECONDARY&amp;quot;
          ),
          size: &amp;quot;MEDIUM&amp;quot;
        ),
        a!richTextItem(
          text: concat(
            &amp;quot;  &amp;quot;,
            local!paging.startIndex,
            &amp;quot; to &amp;quot;,
            if(
              (local!paging.startIndex + local!paging.batchSize) - 1 &amp;gt;length(local!data),
              concat(length(local!items), &amp;quot; &amp;quot;),
              concat((local!paging.startIndex + local!paging.batchSize) - 1, &amp;quot; &amp;quot;)
            )
          ),
          style: { &amp;quot;STRONG&amp;quot; }
        ),
        a!richTextItem(
          text: concat(&amp;quot;of &amp;quot;, length(local!data), &amp;quot;  &amp;quot;),
          color: &amp;quot;SECONDARY&amp;quot;,
          style: {}
        ),
        a!richTextIcon(
          icon: &amp;quot;angle-right-bold&amp;quot;,
          link: a!dynamicLink(
            saveInto: {
              a!save(
                local!paging.startIndex,
                local!paging.startIndex + local!paging.batchSize
              )
            }
          ),
          linkstyle: &amp;quot;STANDALONE&amp;quot;,
          showwhen: (local!paging.startIndex + local!paging.batchSize) - 1 &amp;lt; length(local!data),
          color: &amp;quot;ACCENT&amp;quot;,
          size: &amp;quot;MEDIUM&amp;quot;
        )
      },
      showWhen: length(local!data) &amp;gt; 0,
      align: &amp;quot;CENTER&amp;quot;
    )&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Local Variables&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;  local!data:{
    a!map(id: 1, summary: &amp;quot;PR1&amp;quot;),
    a!map(id: 2, summary: &amp;quot;PR2&amp;quot;),
    a!map(id: 3, summary: &amp;quot;PR3&amp;quot;),
    a!map(id: 4, summary: &amp;quot;PR4&amp;quot;),
    a!map(id: 5, summary: &amp;quot;PR5&amp;quot;),
    a!map(id: 6, summary: &amp;quot;PR6&amp;quot;),
  },
  local!paging:a!map(startIndex:1,batchSize:3),
  local!prs: {
    todatasubset(
      arrayToPage:local!data,
      pagingConfiguration: a!pagingInfo(
        startIndex: local!paging.startIndex, 
        batchSize: local!paging.batchSize,
        sort: a!sortInfo(field: &amp;quot;id&amp;quot;,ascending: true)
      )
    ).data
  }&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Please redo if needed. You can also move the length(local!data) to a local as well.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: collapsible editable grid with selection check boxes</title><link>https://community.appian.com/thread/142974?ContentTypeID=1</link><pubDate>Thu, 21 Nov 2024 07:35:30 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:3280461c-ce9c-4337-b921-6e1c074e13b4</guid><dc:creator>fxzrqjzztrmy</dc:creator><description>&lt;p&gt;How to page this grid?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: collapsible editable grid with selection check boxes</title><link>https://community.appian.com/thread/138477?ContentTypeID=1</link><pubDate>Tue, 23 Jul 2024 01:53:37 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:104106c7-1e0a-4551-9570-9fd1cc9da70a</guid><dc:creator>Konduru Chaitanya</dc:creator><description>&lt;p&gt;You can simply use a button placed over the grid to achieve that. In the buttonWidget use a!save(local!selectedValues,null)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: collapsible editable grid with selection check boxes</title><link>https://community.appian.com/thread/138476?ContentTypeID=1</link><pubDate>Mon, 22 Jul 2024 23:01:22 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c6898e4f-0136-4352-9624-80ce040ece6a</guid><dc:creator>kowsalyavijayan</dc:creator><description>&lt;p&gt;&amp;nbsp;, is there a way to reset the check boxes , upon button click , I have a requirement like, after selecting rows, I will update that in my data base, I wanted to refresh the grid upon button click which should also reset the check boxes.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: collapsible editable grid with selection check boxes</title><link>https://community.appian.com/thread/138452?ContentTypeID=1</link><pubDate>Mon, 22 Jul 2024 12:46:42 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:67794ff8-daff-4734-bb1b-42ebf589667c</guid><dc:creator>kowsalyavijayan</dc:creator><description>&lt;p&gt;thanks . this is what I was expecting&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: collapsible editable grid with selection check boxes</title><link>https://community.appian.com/thread/138421?ContentTypeID=1</link><pubDate>Mon, 22 Jul 2024 04:29:55 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:32e68140-f778-41a4-8b1d-9abd1f9dafac</guid><dc:creator>Karumuru Abhishek</dc:creator><description>&lt;p&gt;hi &lt;a href="/members/kowsalyav7826"&gt;kowsalyavijayan (kowsalyav7826) I&lt;/a&gt;&amp;nbsp;still need to know your requirements, may I know why are you trying to show data grid-tree format?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: collapsible editable grid with selection check boxes</title><link>https://community.appian.com/thread/138419?ContentTypeID=1</link><pubDate>Sun, 21 Jul 2024 19:55:32 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:2b01dcdb-ea02-47df-9257-3da057817c13</guid><dc:creator>Konduru Chaitanya</dc:creator><description>&lt;p&gt;Please take a look at the code below. I have made minor changes and also&amp;nbsp;update local!selectedvalues using the variable where you want to save the values. Please make sure you save only the primary keys of the child data to avoid any duplicates and issues in the code.&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:41px;max-width:170px;" alt=" " height="41" src="/resized-image/__size/340x82/__key/communityserver-discussions-components-files/13/pastedimage1721591627951v1.png" width="170" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!prs: {
    a!map(id: 1, summary: &amp;quot;PR1&amp;quot;),
    a!map(id: 2, summary: &amp;quot;PR2&amp;quot;),
    a!map(id: 3, summary: &amp;quot;PR3&amp;quot;),
    
  },
  local!items: {
    a!map(
      id: 1,
      summary: &amp;quot;item 1&amp;quot;,
      qty: &amp;quot;2&amp;quot;,
      unitPrice: &amp;quot;100&amp;quot;,
      purchaseRequestid: 1
    ),
    a!map(
      id: 2,
      summary: &amp;quot;item 4&amp;quot;,
      qty: &amp;quot;3&amp;quot;,
      unitPrice: &amp;quot;200&amp;quot;,
      purchaseRequestid: 1
    ),
    a!map(
      id: 3,
      summary: &amp;quot;item 7&amp;quot;,
      qty: &amp;quot;2&amp;quot;,
      unitPrice: &amp;quot;250&amp;quot;,
      purchaseRequestid: 3
    ),
    a!map(
      id: 4,
      summary: &amp;quot;item 11&amp;quot;,
      qty: &amp;quot;2&amp;quot;,
      unitPrice: &amp;quot;30&amp;quot;,
      purchaseRequestid: 2
    ),
    a!map(
      id: 5,
      summary: &amp;quot;item 31&amp;quot;,
      qty: &amp;quot;6&amp;quot;,
      unitPrice: &amp;quot;220&amp;quot;,
      purchaseRequestid: 2
    )
  },
  local!selectedValues,
  a!gridLayout(
    headerCells: {
      a!gridLayoutHeaderCell(label: &amp;quot;&amp;quot;),
      a!gridLayoutHeaderCell(label: &amp;quot;Summary&amp;quot;),
      a!gridLayoutHeaderCell(label: &amp;quot;Qty&amp;quot;, align: &amp;quot;RIGHT&amp;quot;),
      a!gridLayoutHeaderCell(label: &amp;quot;Unit Price&amp;quot;, align: &amp;quot;RIGHT&amp;quot;),
      a!gridLayoutHeaderCell(label: &amp;quot;Total Price&amp;quot;, align: &amp;quot;RIGHT&amp;quot;)
    },
    columnConfigs: {
      a!gridLayoutColumnConfig(width: &amp;quot;ICON&amp;quot;),
      a!gridLayoutColumnConfig(width: &amp;quot;DISTRIBUTE&amp;quot;, weight: 4),
      a!gridLayoutColumnConfig(width: &amp;quot;DISTRIBUTE&amp;quot;),
      a!gridLayoutColumnConfig(width: &amp;quot;DISTRIBUTE&amp;quot;, weight: 2),
      a!gridLayoutColumnConfig(width: &amp;quot;DISTRIBUTE&amp;quot;, weight: 2)
    },
    rowHeader: 1,
    rows: a!forEach(
      items: local!prs,
      expression: a!localVariables(
        local!expanded: false,
        local!itemsForPr: index(
          local!items,
          /* Must cast to integer because a!queryEntity() returns a dictionary */
          wherecontains(
            tointeger(fv!item.id),
            local!items.purchaseRequestid
          ),
          {}
        ),
        local!totalPrice: sum(
          a!forEach(
            items: local!itemsForPr,
            expression: tointeger(fv!item.qty) * todecimal(fv!item.unitPrice)
          )
        ),
        {
          a!gridRowLayout(
            contents: {
              a!textField(value: null, readOnly: true),
              a!richTextDisplayField(
                label: &amp;quot;Summary &amp;quot; &amp;amp; fv!index,
                value: {
                  if(
                    length(local!itemsForPr) = 0,
                    fv!item.summary,
                    a!richTextItem(
                      text: if(local!expanded, &amp;quot;-&amp;quot;, &amp;quot;+&amp;quot;) &amp;amp; &amp;quot; &amp;quot; &amp;amp; fv!item.summary,
                      link: a!dynamicLink(
                        value: not(local!expanded),
                        saveInto: local!expanded
                      )
                    )
                  )
                }
              ),
              a!textField(label: &amp;quot;Qty &amp;quot; &amp;amp; fv!index, readOnly: true),
              a!textField(
                label: &amp;quot;Unit Price &amp;quot; &amp;amp; fv!index,
                readOnly: true
              ),
              a!textField(
                label: &amp;quot;Total Price &amp;quot; &amp;amp; fv!index,
                value: a!currency(isoCode: &amp;quot;USD&amp;quot;, value: local!totalPrice),
                readOnly: true,
                align: &amp;quot;RIGHT&amp;quot;
              )
            }
          ),
          if(
            local!expanded,
            a!forEach(
              items: local!itemsForPr,
              expression: a!gridRowLayout(
                contents: {
                  a!richTextDisplayField(
                    value: a!richTextIcon(
                      icon: if(
                        contains(
                          tointeger(local!selectedValues),
                          fv!item.id
                        ),
                        &amp;quot;check-square&amp;quot;,
                        &amp;quot;square-o&amp;quot;
                      ),
                      link: a!dynamicLink(
                        value: fv!item.id,
                        saveInto: if(
                          contains(
                            tointeger(local!selectedValues),
                            fv!item.id
                          ),
                          a!save(
                            local!selectedValues,
                            remove(
                              local!selectedValues,
                              wherecontains(fv!item.id,local!selectedValues)
                            )
                          ),
                          a!save(
                            local!selectedValues,
                            append(local!selectedValues, fv!item.id)
                          )
                        )
                      ),
                      linkStyle: &amp;quot;STANDALONE&amp;quot;
                    )
                  ),
                  a!richTextDisplayField(
                    label: &amp;quot;Item Summary &amp;quot; &amp;amp; fv!index,
                    value: a!richTextBulletedList(items: fv!item.summary)
                  ),
                  a!integerField(
                    label: &amp;quot;Item Qty &amp;quot; &amp;amp; fv!index,
                    value: fv!item.qty,
                    readOnly: true,
                    align: &amp;quot;RIGHT&amp;quot;
                  ),
                  a!textField(
                    label: &amp;quot;Item Unit Price &amp;quot; &amp;amp; fv!index,
                    value: a!currency(isoCode: &amp;quot;USD&amp;quot;, value: fv!item.unitPrice),
                    readOnly: true,
                    align: &amp;quot;RIGHT&amp;quot;
                  ),
                  a!textField(
                    label: &amp;quot;Item Total Price &amp;quot; &amp;amp; fv!index,
                    value: a!currency(
                      isoCode: &amp;quot;USD&amp;quot;,
                      value: tointeger(fv!item.qty) * todecimal(fv!item.unitPrice)
                    ),
                    readOnly: true,
                    align: &amp;quot;RIGHT&amp;quot;
                  )
                }
              )
            ),
            {}
          )
        }
      )
    )
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: collapsible editable grid with selection check boxes</title><link>https://community.appian.com/thread/138357?ContentTypeID=1</link><pubDate>Fri, 19 Jul 2024 21:23:05 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:724fb684-80dd-462d-8d54-e4d7628cd40a</guid><dc:creator>kowsalyavijayan</dc:creator><description>&lt;p&gt;I am trying to implement the same thing mentioned here&amp;nbsp;&lt;a id="" href="https://docs.appian.com/suite/help/24.2/recipe-expand-collapse-rows-in-a-tree-grid.html"&gt;https://docs.appian.com/suite/help/24.2/recipe-expand-collapse-rows-in-a-tree-grid.html&lt;/a&gt;&amp;nbsp;but i wanted to add selection checkboxes for the sub items only.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: collapsible editable grid with selection check boxes</title><link>https://community.appian.com/thread/138337?ContentTypeID=1</link><pubDate>Fri, 19 Jul 2024 13:10:03 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c876290e-da6d-4a83-a804-c3446a0a43ef</guid><dc:creator>kowsalyavijayan</dc:creator><description>&lt;p&gt;the editable grid is connected to the record type, i wanted to save the entire row upon selection to commit back to the backend, yes, I&amp;nbsp; want multiple selection. I dont want selection on the row that has heading but only the sub items.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: collapsible editable grid with selection check boxes</title><link>https://community.appian.com/thread/138325?ContentTypeID=1</link><pubDate>Fri, 19 Jul 2024 08:31:06 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:079d248f-1715-4055-8a81-0e90fc21dd68</guid><dc:creator>Konduru Chaitanya</dc:creator><description>&lt;p&gt;Need more details on your data structure. What variables the data should flow in on clicking the check boxes and also do you want it to be multiple selection. more details please.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>