Coast Line
asked on
bringing Data in Chunks Coldfusion
Hi, I am making one ajax call as:
$.ajax({ type:"POST", url:"welcome.cfm", data: data, success: function (html) { $('#message').html(html); } }); return false;
So now i want that i should return 100 records first time it calls that Page, now i want to apply the Paging to that also. So when i cick the next record or any number in paging say 5, it should display that data and make an ajax call to get that data, this way i think it will be better to handle millions of records!
Also i cannot use cfgrid, jquery preferred. if i can get the data as JSON and parse on client ide, i think that can make performance faster!
Guide
$.ajax({ type:"POST", url:"welcome.cfm", data: data, success: function (html) { $('#message').html(html); } }); return false;
So now i want that i should return 100 records first time it calls that Page, now i want to apply the Paging to that also. So when i cick the next record or any number in paging say 5, it should display that data and make an ajax call to get that data, this way i think it will be better to handle millions of records!
Also i cannot use cfgrid, jquery preferred. if i can get the data as JSON and parse on client ide, i think that can make performance faster!
Guide
if you are using mysql, then why don't you use limit and offset to get only that many number of rows from database
ASKER
i am not using mysql
sorry
sorry
then which one?
ASKER
oracle
you can do the same in oracle using rownum
http://www.delphifaq.com/faq/databases/oracle/f594.shtml
http://www.componentworkshop.com/blog/2009/05/07/oracle-limiting-the-number-of-records-like-top-n-limit
http://www.delphifaq.com/faq/databases/oracle/f594.shtml
http://www.componentworkshop.com/blog/2009/05/07/oracle-limiting-the-number-of-records-like-top-n-limit
ASKER
well if i get a sample for this that will be good
I would think you need to pass the page number to the ajax call, otherwise how will the query know which page of 100 records to return? It may be even better to pass both page number and page size (in case you want to allow the user to vary their page size in the future)
ASKER
yes that will be, but how. that is confusion
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
nope used the between operator and worked like a charm Thanks
ASKER
thanks for showing a way