<?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>add row in inline grid with other data as read only</title><link>https://community.appian.com/discussions/f/user-interface/20058/add-row-in-inline-grid-with-other-data-as-read-only</link><description>Team, 
 I have a requirement where data is coming from database and appearing in editable grid all components in grid have read only set to true , i am using dynamic link to delete and add row. 
 
 Delete is fine but when i click on add new row , all</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: add row in inline grid with other data as read only</title><link>https://community.appian.com/thread/78422?ContentTypeID=1</link><pubDate>Thu, 10 Dec 2020 16:19:53 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:82768aae-f087-4fd1-9c3f-4057ed700620</guid><dc:creator>Chris</dc:creator><description>&lt;p&gt;Totally correct sir!&amp;nbsp; That was a quick-and-dirty &lt;span class="emoticon" data-url="https://community.appian.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="csharp"&gt;a!localVariables(
  local!data: {
    {id: 1, field: &amp;quot;test1&amp;quot;},
    {id: 2, field: &amp;quot;test2&amp;quot;}
  },
  a!gridLayout(
    headerCells: {a!gridLayoutHeaderCell(label: &amp;quot;Test&amp;quot;)},
    totalCount: count(local!data),
    rows: a!forEach(
      items: local!data,
      expression: a!gridRowLayout(
        id: fv!index,
        contents: {
          a!textField(
            value: fv!item.field,
            saveInto: fv!item.field,
            readOnly: not(isnull(fv!item.id))
          )
        }
      )
    ),
    addRowLink: aa!dynamicLink(
      label: &amp;quot;Add Row&amp;quot;,
      value: {},
      saveInto: a!save(local!data,append(local!data,{id: null, field: null}))
    )
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: add row in inline grid with other data as read only</title><link>https://community.appian.com/thread/78421?ContentTypeID=1</link><pubDate>Thu, 10 Dec 2020 16:18:23 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:25932392-92fc-4b9e-b953-ae1ecbb875c8</guid><dc:creator>gauravp0003</dc:creator><description>&lt;p&gt;thank you guys ,i got you point .&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: add row in inline grid with other data as read only</title><link>https://community.appian.com/thread/78420?ContentTypeID=1</link><pubDate>Thu, 10 Dec 2020 16:15:58 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:1376e7ef-8f92-49b0-932d-f4085440bea5</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;FWIW, I believe (at least in a big picture / code readability sense) it&amp;#39;s better to use &amp;quot;fv!item&amp;quot; rather than &amp;quot;local!data[fv!index]&amp;quot; to address array fields.&amp;nbsp; Sorry if this seems overly picky &lt;span class="emoticon" data-url="https://community.appian.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="java"&gt;a!textField(
  value: fv!item.field,
  saveInto: fv!item.field,
  readOnly: not(isnull(fv!item.id))
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: add row in inline grid with other data as read only</title><link>https://community.appian.com/thread/78418?ContentTypeID=1</link><pubDate>Thu, 10 Dec 2020 16:11:57 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:cfb9fe71-bdd6-4a28-ac14-5e7d2ce7f370</guid><dc:creator>Chris</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="csharp"&gt;a!localVariables(
  local!data: {
    {id: 1, field: &amp;quot;test1&amp;quot;},
    {id: 2, field: &amp;quot;test2&amp;quot;}
  },
  a!gridLayout(
    headerCells: {a!gridLayoutHeaderCell(label: &amp;quot;Test&amp;quot;)},
    totalCount: count(local!data),
    rows: a!forEach(
      items: local!data,
      expression: a!gridRowLayout(
        id: fv!index,
        contents: {
          a!textField(
            value: local!data[fv!index].field,
            saveInto: local!data[fv!index].field,
            readOnly: not(isnull(local!data[fv!index].id))
          )
        }
      )
    ),
    addRowLink: aa!dynamicLink(
      label: &amp;quot;Add Row&amp;quot;,
      value: {},
      saveInto: a!save(local!data,append(local!data,{id: null, field: null}))
    )
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: add row in inline grid with other data as read only</title><link>https://community.appian.com/thread/78417?ContentTypeID=1</link><pubDate>Thu, 10 Dec 2020 16:07:34 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:0ecc8e65-0bbd-4c2d-9040-99389b683a67</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;I&amp;#39;m not exactly clear on what you still need, but it&amp;#39;s all in the &lt;a href="https://docs.appian.com/"&gt;Appian documentaton&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: add row in inline grid with other data as read only</title><link>https://community.appian.com/thread/78416?ContentTypeID=1</link><pubDate>Thu, 10 Dec 2020 16:06:05 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:054c981d-b292-4199-946b-576112e92765</guid><dc:creator>gauravp0003</dc:creator><description>&lt;p&gt;Thank you , do you have any reference which i can use ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: add row in inline grid with other data as read only</title><link>https://community.appian.com/thread/78412?ContentTypeID=1</link><pubDate>Thu, 10 Dec 2020 15:44:42 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:0099012b-2f09-4546-9cf6-fb81241fab48</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;You will first need to decide how your interface will tell the difference between &amp;quot;just added&amp;quot; items in the Data Array, versus ones that were already there.&amp;nbsp; Perhaps the prior data has a primary key, and the new row does not?&amp;nbsp; In this case, your row elements can simply determine whether the row data has a blank primary key, and set read-only to TRUE only in these cases.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>