[Catalyst] AJAX question

Yuval Kogman nothingmuch at woobling.org
Mon Jan 30 12:40:00 CET 2006


On Mon, Jan 30, 2006 at 12:35:59 +0100, Kiefer, Sascha wrote:
> Hi,
> 
> I have the following problem:
> I read mails from a POP3 server. Reading all messages on one GET can be
> slow. 
> So i get them using AJAX. The page contains all ids of the messages and i 
> retrieve them by requesting each message like
> /mailbox/message_header/?id=<the id>.
> 
> At the time the message is loaded, i do not know anything about the order of
> the messages.
> 
> But on the server, I'll retrieve one message at the time and store it -
> sorted by date - in an array.
> So i actually can tell the client at which position it should display the
> message.
> 
> Do you know a way that let's me position the new message information before
> or after an already retrieved message?

Look at the live grid examples:

	http://openrico.org/rico/livegrid.page

They populate a table.

The 'update' param can also be used for Ajax updaters. The default
update form is "replace", but there is also "before", "after", and i
think something for the inner section.

Note that before/after do not work with tables under IE, so if you
go by that path you need to make a bunch of divs. This sucks also,
because IE doesn't support 'display: table' or whatever that CSS
option is called, so you need to really shape the divs manually.

IIRC in the Rico example they pre-create the table, with 10 rows,
and then replace the data with data from an array, and somehow
attach to the scroll bar actions, but the scroll bar is completely
detached from the actual data displaying table.

Keep a notion of an index, e.g.

	messages[i] = get_message(i);

for each message, and then populate the table with the array
elements in 'messages'.

-- 
 ()  Yuval Kogman <nothingmuch at woobling.org> 0xEBD27418  perl hacker &
 /\  kung foo master: *shu*rik*en*sh*u*rik*en*s*hur*i*ke*n*: neeyah!!!!

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.rawmode.org/pipermail/catalyst/attachments/20060130/5134ec4c/attachment.pgp


More information about the Catalyst mailing list