« Return to Thread: Re: JSON Object to FilteringTable

Re: JSON Object to FilteringTable

by Tom Trenka :: Rate this Message:

Reply to Author | View in Thread

I should just convince you to write the docs on the widget :)

trt

Ross Thomas wrote:
Jayaram Krishnaswamy wrote:
Does the JSON data always need to go through an intermediary store to the filtering table?
Yes.  The store is the repository of the data that is displayed by the FilteringTable.
Thus they are essentially a single unit in this context.  By manipulating the store
you are causing changes to be reflected in the table.

Does it needs to be converted into an array before populating the table?
Is it OK to unpack the object and stuff it into a table like one normaly does populating a table looping through the elements?
The setData() and addDataRange() methods are the most efficient when dealing
with multiple updates.  If a single object is changed then use the addData() method
to add the object or replace it if there is already an entry with the same key.

You can use the update() method to update a single field within an element if that
is all that changed.

All these Store methods invoke events that cause the FilteringTable to update the
view accordingly.  Thus a sequence of single addData() calls will cause 'n' events.
A single addDataRange() call will cause 1 event.  Hence the greater efficiency.

There is a case for 'chunking' of range updates to maintain UI responsiveness but
that is something that is usually discerned on a case by case basis.

HTH

Ross.

 « Return to Thread: Re: JSON Object to FilteringTable