Cool I see your point. I thought it would be quicker to do everything client side but my knowledge of client side processing is fairly limited. I'm going to do this server side like you suggested but I'm going to leave the question open for a while to see if any one else has any additional input.
Thanks
Dave
Main Topics
Browse All Topics





by: gagaliyaPosted on 2004-11-04 at 11:18:30ID: 12497095
dave, you will always get burned at the end trying to manipulate large datasets using javascript, it is bad because:
1)javascript is local system dependent, no way for you to control the performance. if you have like a couple thousand rows and do data massaging on them, your app will slow to a crawl.
2)does not reflect real time data changes. someone updates the db, they will not see the change.
3)more complicated to code with little to no debugging besides using a lot of alert boxes.
i suggest you do paging on the serverside. simply make a current_index and row_per_page variable. Everytime the user clicks on next or previous add or subtract row_per_page to current_index, do your normal sql to get the entire dataset. then in your jsp/asp etc loop, dont bother print the rows in your html until the current_index is reached, then print row_per_page number of rows.
The downside is a delay to the user when they click next/previous as it is hitting the server, but this is the right way to do paging. Check the messageboards, or yahoo/google etc, it's all based on this idea.