On Tue, Oct 19, 2010 at 17:03, aditya siram <[email protected]> wrote:
> Hi all,
> I have a qx.ui.table.Table with a large number of rows (50000). Sorting on
> the, as you many imagine, takes some time and times out on IE 7.
You're going about this the wrong way. Just stop using IE and all of your
problems will instantly disappear. :-)
> To deal with this, I would like to overlay a blocker over the table with a
> loading spinner gif, but unfortunately I can't seem to catch it before
> sorting starts. With all the methods I've tried the blocker appears *after*
> sorting has finished. So far I've tried:
> 1. listening for the "beforeSort" event fired by qx.ui.table.Scroller
> 2. extending qx.ui.model.model.Simple with a function that runs before
> "sort" runs in sortByColumn
> 3. extending qx.ui.pane.Scroller with function that runs before
> "sortByColumn" is invoked in the "_onClickHeader" method.
>
> I haven't looked into the SmartTableModel yet because I'd rather not
> maintain multiple views if I can get it working this way.
>
The problem you're encountering is because JavaScript is single-threaded. In
your overridden sortByColumn(), you're creating the blocker, but not
providing any time for that blocker to be rendered before you immediately go
into your long sort routine. What you need to do could be accomplished this
way, I think:
1. In your overridden sortByColumn(), create your blocker. Do not call
this.base() from your overridden sortByColumns() because you do not want
that sort to begin.
2. Since the sort function is timing out, the blocker alone won't fix
that. You need to arrange for your sort to be done in pieces, returning
control to the browser periodically. That means you'll have to write your
own sort routine (not use the built-in sort, at least for sorting the entire
table; it could be used for sorting portions of the table if you wanted).
You want to sort the table in chunks of time, with control returned to the
browser after each time chunk. You may find either multiple calls via a
timer (qx.util.TimerManager) or the progressive renderer
(qx.ui.progressive.Progressive) to be useful for doing that. It's not
entirely trivial.
50000 lines in the table isn't *that* huge, although it is large. A better
bet for you, if you absolutely must support IE and tables of this size, is
to use the Remote table model, and do the sorting at the server.
Hopefully that gives you some ideas to work with.
Derrell
------------------------------------------------------------------------------
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel