<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Help with Null in dojo grid / store in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/help-with-null-in-dojo-grid-store/m-p/240164#M22280</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks John! You pointed me in the right direction!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I attached a formatter to the field&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;th field="COMPANY" width="150px" formatter='fixNull'&amp;gt;Company&amp;lt;/th&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then wrote a function to replace any null with an empty value.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;function fixNull(companyName, rowIndex){&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;noValue = "";&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if( dojo.string.trim(companyName) == "Null") { //company field was null so use noValue&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;var rowdata = this.grid.getItem(rowIndex);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;return noValue;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;} else {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;return companyName;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 07 Sep 2011 16:38:05 GMT</pubDate>
    <dc:creator>RobinWoodsong</dc:creator>
    <dc:date>2011-09-07T16:38:05Z</dc:date>
    <item>
      <title>Help with Null in dojo grid / store</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/help-with-null-in-dojo-grid-store/m-p/240162#M22278</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;We do a query and some of the fields for 'Company' have values and some don't. For the fields that don't have a value the grid displays Null and I would like to remove that or simply replace it with a blank space. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;After the query but before the grid.setStore I have:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; store.fetch({query: {Company:Null}});&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;// Process the items and update attribute&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; for (var i = 0; i &amp;lt; items.length; i++){&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var item = items&lt;I&gt;;&lt;/I&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; store.setValue(item, "Company", (" "));&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; // If the store has modified items (it should), call save with the handlers above.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; if (store.isDirty()){&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; store.save();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But it doesn't work and I don't know why. Any help appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Robin&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Sep 2011 15:27:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/help-with-null-in-dojo-grid-store/m-p/240162#M22278</guid>
      <dc:creator>RobinWoodsong</dc:creator>
      <dc:date>2011-09-06T15:27:25Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Null in dojo grid / store</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/help-with-null-in-dojo-grid-store/m-p/240163#M22279</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Robin,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[INDENT]try this:[/INDENT]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;store.setValue(item, "Company", " ");&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[INDENT]However, I would recommend you instead check out the 'formatter' and 'get' attributes of the '&amp;lt;th&amp;gt;' table element as they provide additional control of the displayed content in the cell. More information can be found &lt;/SPAN&gt;&lt;A href="http://dojotoolkit.org/reference-guide/dojox/grid/DataGrid.html"&gt;here&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[/INDENT]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;John&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Sep 2011 23:13:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/help-with-null-in-dojo-grid-store/m-p/240163#M22279</guid>
      <dc:creator>JohnGrayson</dc:creator>
      <dc:date>2011-09-06T23:13:19Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Null in dojo grid / store</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/help-with-null-in-dojo-grid-store/m-p/240164#M22280</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks John! You pointed me in the right direction!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I attached a formatter to the field&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;th field="COMPANY" width="150px" formatter='fixNull'&amp;gt;Company&amp;lt;/th&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then wrote a function to replace any null with an empty value.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;function fixNull(companyName, rowIndex){&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;noValue = "";&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if( dojo.string.trim(companyName) == "Null") { //company field was null so use noValue&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;var rowdata = this.grid.getItem(rowIndex);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;return noValue;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;} else {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;return companyName;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Sep 2011 16:38:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/help-with-null-in-dojo-grid-store/m-p/240164#M22280</guid>
      <dc:creator>RobinWoodsong</dc:creator>
      <dc:date>2011-09-07T16:38:05Z</dc:date>
    </item>
  </channel>
</rss>

