JSON Object to FilteringTable
Jayaram Krishnaswamy wrote:
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.
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.
--
View this message in context: http://www.nabble.com/Re%3A-JSON-Object-to-FilteringTable-tf3158017.html...
Sent from the Dojo mailing list archive at Nabble.com.
Dojo Forum
Comments
Jayaram Krishnaswamy wrote:
Yes.
Jayaram Krishnaswamy wrote:
Considering that a table is usually a representation of a set of objects in
a non-named manner (i.e. an array), yes.
Jayaram Krishnaswamy wrote:
If you want to deal with poor performance, sure. But I think you're
confusing generating a string on a server with manipulating a DOM on a
client...
trt
_______________________________________________
Dojo FAQ: http://dojo.jot.com/FAQ
Dojo Book: http://manual.dojotoolkit.org/DojoDotBook
Dojo-interest@dojotoolkit.org
http://dojotoolkit.org/mailman/listinfo/dojo-interest
--
View this message in context: http://www.nabble.com/Re%3A-JSON-Object-to-FilteringTable-tf3158017.html...
Sent from the Dojo mailing list archive at Nabble.com.
I should just convince you to write the docs on the widget :)
trt
Ross Thomas wrote:
--
View this message in context: http://www.nabble.com/Re%3A-JSON-Object-to-FilteringTable-tf3158017.html...
Sent from the Dojo mailing list archive at Nabble.com.
Thanks for the kind answers. I did go to the Dojo API and found similar
information. The API documents can be even more powerful if links can be set
to usage examples(at least the most common ones). None of the
API's(Microsfot,Java,SQLServer etc) I have seen do this, may be there is a
reason.
----- Original Message -----
From: "Tom Trenka"
To:
Sent: Thursday, February 01, 2007 6:31 PM
Subject: Re: [Dojo-interest] JSON Object to FilteringTable
Tom Trenka wrote:
Heh! Sorry Tom. Didn't mean to steal your thunder.
But you are right. There is a lot of use-based experience out
there that would be a great resource if only it could be tapped
in a useful way. Wiki's are all well and good, but they are a
little disorganized and fall short when trying to reach a distinct
goal.
As a developer myself I am guilty of the 'code now, document
later.' syndrome. :-/
Ross.
--
View this message in context: http://www.nabble.com/Re%3A-JSON-Object-to-FilteringTable-tf3158017.html...
Sent from the Dojo mailing list archive at Nabble.com.
Actually I was kind of serious about that; I find it to be very instructional
when documentation comes from someone who didn't actually write the code but
seems to know it pretty well.
And we're working on the suggestion.
trt
Ross Thomas wrote:
--
View this message in context: http://www.nabble.com/Re%3A-JSON-Object-to-FilteringTable-tf3158017.html...
Sent from the Dojo mailing list archive at Nabble.com.
Dude,
Would you mind actually *looking* through the code at some point before
giving someone inaccurate answers? Allow me to debunk inline.
Sasha Firsov wrote:
This is actually incorrect, though I can see where you might think
that...the reality is that there are 2 ways of populating a FilteringTable:
via JSON, and by simply turning a straight HTML table into the widget.
*However*, if you use the second method, the widget will, on initialization
(essentially in .postCreate), *convert* all of the data in the HTML table to
a JSON array and use it to populate the underlying Store object. The
converter is actually a static method of the Store, you can see it for
yourself.
Sasha Firsov wrote:
I would *highly* suggest that you *don't* fill out a table that way; that
method is meant for incremental updates and not for populating wholesale.
There is a reason for .setData and .addDataRange; use it, and use an array.
Again, the reality is that the default init procedure will, in the very
least, create a Store with an empty array as the inner list.
Sasha Firsov wrote:
That method is meant for existing fields. You know, like UPDATE in SQL?
Sasha Firsov wrote:
While I do appreciate your responses it's becoming apparent that you don't
really consider performance to be a concern, whereas you really should.
There are a lot of limitations to working with tables in HTML--let alone add
additional functionality via JS--and making blanket assumptions about
performance is really not an option in JS...unless you think that others
using your code, like yourself, don't care about it. I'd suggest that's a
really bad attitude to have; once you start to factor in performance, you'll
start to understand some of the decisions I made in writing that widget, and
a good portion of decisions other contributors have made throughout Dojo.
trt
--
View this message in context: http://www.nabble.com/Re%3A-JSON-Object-to-FilteringTable-tf3158017.html...
Sent from the Dojo mailing list archive at Nabble.com.
It would seem to me that there should be a method to add row(s) based on HTML
and having a function auto-convert it to JSON as you described.
Tom Trenka wrote:
--
View this message in context: http://www.nabble.com/Re%3A-JSON-Object-to-FilteringTable-tf3158017.html...
Sent from the Dojo mailing list archive at Nabble.com.
Tom Trenka wrote:
Well, I have a deadline looming that is taking most of my
time these days (hence the low response flow to the
list). I could certainly give it a shot after that. Is there
a preferred/official documentation style?
I assume this is part of the ongoing discussions the core
group is having. Should be interesting once it sees the
light of day.
Ross.
--
View this message in context: http://www.nabble.com/Re%3A-JSON-Object-to-FilteringTable-tf3158017.html...
Sent from the Dojo mailing list archive at Nabble.com.
Nothing yet, and there are some fairly extensive changes coming up. But
after that, it would be helpful to know that we could ask for documentation
help efforts...
trt
Ross Thomas wrote:
--
View this message in context: http://www.nabble.com/Re%3A-JSON-Object-to-FilteringTable-tf3158017.html...
Sent from the Dojo mailing list archive at Nabble.com.