<?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>display the result of a view in an editable grid</title><link>https://community.appian.com/discussions/f/general/10891/display-the-result-of-a-view-in-an-editable-grid</link><description>I am planning to display the result of a view in an editable grid . Can anyone please give me an example ? 
 The number of rows is fixed but i dont want to write a!gridRowLayout() 44 times as shown in the example of 2 rows</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: display the result of a view in an editable grid</title><link>https://community.appian.com/thread/56667?ContentTypeID=1</link><pubDate>Thu, 14 Jun 2018 16:11:55 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:085ba283-a407-4e8e-8655-4b66f330319d</guid><dc:creator>oscarb907</dc:creator><description>Also, don&amp;#39;t forget to create a constant to hold the reference to the CDT so you can access the view.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: display the result of a view in an editable grid</title><link>https://community.appian.com/thread/47702?ContentTypeID=1</link><pubDate>Thu, 17 Aug 2017 14:58:59 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:0d767ffd-76e1-493e-8f8c-1920ce43582a</guid><dc:creator>Josh</dc:creator><description>If you are not on 17.2 you will need to use a!applyComponents(). You will also need to create a rule for your grid row layout. The following SAIL recipe gives an example of how to do this: &lt;a href="https://docs.appian.com/suite/help/17.1/recipe_add_edit_and_remove_data_in_an_inline_editable_grid.html"&gt;docs.appian.com/.../recipe_add_edit_and_remove_data_in_an_inline_editable_grid.html&lt;/a&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: display the result of a view in an editable grid</title><link>https://community.appian.com/thread/47701?ContentTypeID=1</link><pubDate>Thu, 17 Aug 2017 14:57:03 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:0e6b75b8-509b-470d-a806-6c780e8afe5f</guid><dc:creator>Shreehari Gopalakrishnan Ramanan</dc:creator><description>Thanks Josh,&lt;br /&gt;
&lt;br /&gt;
We are not in 17.2 yet.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: display the result of a view in an editable grid</title><link>https://community.appian.com/thread/47667?ContentTypeID=1</link><pubDate>Wed, 16 Aug 2017 22:54:45 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:a70c6bfd-da0b-4a53-87be-75facd654969</guid><dc:creator>aloks0189</dc:creator><description>There can be a use case, when your view returns duplicate Primary Key value (which is rare), when you go for pagingGrid, it will throw an error, because pagingGrid expects unique identifier, so in such cases we need to go for editable grid with readOnly field.&lt;br /&gt;
&lt;br /&gt;
Now when we talk about hardcoding, as per my understanding a!forEach() function which was released in 17.2 version, will be the best choice as &lt;a href="/members/joshl"&gt;Josh&lt;/a&gt; already have explained above.&lt;br /&gt;
&lt;br /&gt;
Hope this will help you.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: display the result of a view in an editable grid</title><link>https://community.appian.com/thread/47665?ContentTypeID=1</link><pubDate>Wed, 16 Aug 2017 21:45:22 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:b1660bf3-70ba-4e44-b84e-44a410df9985</guid><dc:creator>Josh</dc:creator><description>&lt;p&gt;You can leverage a!forEach() to avoid hardcoding the grid rows:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;=load(
  local!items: {
    {item: &amp;quot;Item 1&amp;quot;, qty: 1, unitPrice: 10},
    {item: &amp;quot;Item 2&amp;quot;, qty: 2, unitPrice: 20}
  },
  a!gridLayout(
    label: &amp;quot;Grid Layout&amp;quot;,
    instructions: &amp;quot;This is a grid layout&amp;quot;,
    headerCells: {
      a!gridLayoutHeaderCell(label: &amp;quot;Item&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&amp;quot;, align: &amp;quot;RIGHT&amp;quot;)
    },
    rows: a!forEach(
      items: local!items,
      expression: a!gridRowLayout(
        contents: {
            a!textField(
            value: index(fv!item, &amp;quot;item&amp;quot;, null),
            saveInto: fv!item.item
          ),
          a!integerField(
            value: index(fv!item, &amp;quot;qty&amp;quot;, null),
            saveInto: fv!item.qty,
            align: &amp;quot;RIGHT&amp;quot;
          ),
          a!floatingPointField(
            value: index(fv!item, &amp;quot;unitPrice&amp;quot;, null),
            saveInto: fv!item.unitPrice,
            align: &amp;quot;RIGHT&amp;quot;
          ),
          a!textField(
            value: dollar(tointeger(index(fv!item, &amp;quot;qty&amp;quot;, 0)) * todecimal(index(fv!item, &amp;quot;unitPrice&amp;quot;, 0))),
            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: display the result of a view in an editable grid</title><link>https://community.appian.com/thread/47664?ContentTypeID=1</link><pubDate>Wed, 16 Aug 2017 21:41:01 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:49706e01-b468-4c3e-b97e-b8f55b9b09b7</guid><dc:creator>naveenp878</dc:creator><description>Hi, You mean database view. If so, can you tell why you want to show in editable grid ?&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>