Select to view content in your preferred language

DataGrid automatic refresh

3829
4
02-05-2014 06:13 AM
MichelleRogers1
Occasional Contributor
I am developing an application where the feature layer is dynamic and refreshes every 5 seconds.  I would like for the DataGrid that is in the application to refresh at the same time interval so that we can show speed in the DataGrid and have it accurate along with the vehicle pop-up.  Is there a way to do this, or is that not a supported function for the DataGrid yet?
0 Kudos
4 Replies
JonathanUihlein
Esri Regular Contributor
Absolutely!

For this task, I would highly recommend using dgrid over dojox.datagrid.

Depending on your data source, you have several options:

dgrid (OnDemandGrid) with a standard Memory store.

Refresh the grid when your featureLayer update event fires --- myGrid.refresh();

dgrid (OnDemandGrid) with a JsonRest store. Automatically updates depending on your external JSON data.

http://dojotoolkit.org/reference-guide/1.9/dojo/store/JsonRest.html

http://dojofoundation.org/packages/dgrid/tutorials/grids_and_stores/

https://github.com/SitePen/dgrid/wiki/OnDemandList-and-OnDemandGrid


These are only two of the many options available to you.
At the end of the day, it depends on what you feel comfortable with.
0 Kudos
MichelleRogers1
Occasional Contributor
Absolutely!

For this task, I would highly recommend using dgrid over dojox.datagrid.

Depending on your data source, you have several options:

dgrid (OnDemandGrid) with a standard Memory store.

Refresh the grid when your featureLayer update event fires --- myGrid.refresh();

dgrid (OnDemandGrid) with a JsonRest store. Automatically updates depending on your external JSON data.

http://dojotoolkit.org/reference-guide/1.9/dojo/store/JsonRest.html

http://dojofoundation.org/packages/dgrid/tutorials/grids_and_stores/

https://github.com/SitePen/dgrid/wiki/OnDemandList-and-OnDemandGrid


These are only two of the many options available to you.
At the end of the day, it depends on what you feel comfortable with.


Jonathan,

I am attempting to insert the dgrid into the existing application instead of the dojox DataGrid.  Right now, when I go to the webpage, it shows everything but the basemap, and the contents of the dgrid.  It shows the headers, but not the data.  I posted it to jsfiddle, but I must be doing something wrong, because it doesn't even give me that in the result box.  This is the first time I have used jsfiddle.  The link for the jsfiddle is: http://jsfiddle.net/mrogers83/49LBL/9/

Any help you can give me to get this working, and refreshing automatically is very much appreciated.

Michelle
0 Kudos
MichelleRogers1
Occasional Contributor
I was trying to attach a screen shot of what is happening on the client side of the webpage that I can get to work more than the jsfiddle.

Here is that screenshot:
[ATTACH=CONFIG]31199[/ATTACH]
0 Kudos
RickeyFight
MVP Regular Contributor

Michelle,

Did you ever get this to work?

0 Kudos