PDA

View Full Version : How to view arrays in grid or template in extjs



sujeetkr
27 Sep 2012, 5:54 AM
Hi,
I am maintaining an array. It contains some key values pairs and it keeps changing. How can I view this array in extjs?
eg : var arr =[], arr['abc'] ='online'; arr['def']='offline' etc

Can I use grid panel to view this array? Like two column grid panel, where first column will contain key and second column will contain value.

Also I would like to update the grid panel, if array values changes.

Can I use template for above purpose? How can I use template?

Problem I face: The dataprovider for the gridpanel is store. How can I convert my array to store data type?

What are your recommendations to do that?


Thanks,
Sujeet

scottmartin
1 Oct 2012, 8:55 PM
You can use an array store that is assigned to the grid and simply update the record to update the grid ... see record.set() to update.

Scott.