ajax table

T

toffee

Hi,

I need some pointers as I have no idea how to get started.

I have a large table which pulls data from a mysql db. Because of the large
number of records, it clugs up lot of memory and the browser massively slows
down when scrolling down.
What I would like to do is pull say 50 records and make the scrollbar as
long as if all records were retrieved; then use the on scroll event to
retrieve another 50 records based on far the scroll was (i'd assume using
ajax).

Any ideas please ?

Kind regards

T
 
S

shimmyshack

Hi,

I need some pointers as I have no idea how to get started.

I have a large table which pulls data from a mysql db. Because of the large
number of records, it clugs up lot of memory and the browser massively slows
down when scrolling down.
What I would like to do is pull say 50 records and make the scrollbar as
long as if all records were retrieved; then use the on scroll event to
retrieve another 50 records based on far the scroll was (i'd assume using
ajax).

Any ideas please ?

Kind regards

T

there is an example of this over on http://www.openrico.org/rico/livegrid.page
but be warned, if someone comes visiting with javascript off, like me,
your entire table will be loaded as one single table, this is great
for those like me who wont turn on js unless its needed, but might
break stuff, so do paginate, or have some kind of limit implied to
start with.
over here:
http://groups.google.co.uk/group/al...st&q="i+think"&rnum=35&hl=en#e0cfc5e95c710908
there's an example of pagination the old fashioned way.
 
R

Richard Maher

Mr T,

(Sorry :)

toffee said:
Hi,

I need some pointers as I have no idea how to get started.

I have a large table which pulls data from a mysql db. Because of the large
number of records, it clugs up lot of memory and the browser massively slows
down when scrolling down.
What I would like to do is pull say 50 records and make the scrollbar as
long as if all records were retrieved; then use the on scroll event to
retrieve another 50 records based on far the scroll was (i'd assume using
ajax).

Any ideas please ?

Kind regards

T

Just another of those posts that won't help you I'm afraid, but I am very
interested in knowing if you would use the following strategy if it was
available to you: -

1) The rows are retrieved one by one and placed into your select-list/table
as they arrive from the server so that the user's interest is maintained.
2) The scroll bar shrinks as the number of rows grows (or you could have a
counter running) so the user is kept up to date with progress/feed-back
3) Your Javascript code can be enriching/adding-value to each row returned
(xlating codes into descriptions?) so you can get this crazy parallelism
thing happening to boost query performance
4) You have a hot-abort button available that will asynchronously deliver an
abort instruction to your server code (break the FOR loop on your cursor?)
5) If you hit "abort", those rows already retrieved are available for
scrutiny, and an alert message can confirm to the user that the retrieval
terminated prematurely

Sounds like the Mut's Nuts to me, but then why isn't anyone doing it?
Paging's pretty crap IMHO and without explicit server affinity control,
"Hold" cursors aren't much use, but I'm a newbie to HTML, Javascript, Ajax
so I'm sure there are other options?

I'm sure I saw a CANCEL option/call for an AJAX request the other day (MSDN
I think?) And the fact that AJAX is asynchronous means you can use a simple
HTML button for the abort trigger (and not have to worry about an Applet
dialog box like me :-() Sounds like this might work for you? Is the problem
that AJAX is so shite that it has to return the entire result set in one
message? (and if you cancel that then you merely cancel the clients receipt
of the results and never tell the server that you simply just forgot to
specify any useful keys to join on :)

Anyway, please report back on what you eventually decide to go with. (Maybe
the KISS principle and just ask the user for a maximum, then do a SELECT
FIRST N or LIMIT TO n ROWS)

Cheers Richard Maher

PS. More examples of what I don't know: -

Why is memory an issue to you? We are talking Virtual memory (and presumably
page files) aren't we? If it's a mutli-user system then there are page file
quotas et al aren't there? Maybe not? Browser issues?

Is there a limit on SelectList or Table size? Integer, Word? BigInt?
 
T

TheBagbournes

toffee said:
Hi,

I need some pointers as I have no idea how to get started.

I have a large table which pulls data from a mysql db. Because of the large
number of records, it clugs up lot of memory and the browser massively slows
down when scrolling down.

Use the "Ext" RIA/Ajax library.

Demo (one of many under the /examples directory):

http://www.yui-ext.com/deploy/ext-1.0-alpha3/examples/grid/paging.html

It's reasonably easy to set up a grid which requests segments of data by sending XHRs back to a configurable URI on your server which returns either XML or JSON representing the rows.

Download: http://www.yui-ext.com/deploy/ext-1.0-alpha3.zip

Support forum: http://www.yui-ext.com/forum/index.php

Have fun!

Animal
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top