By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,504 Members | 1,190 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,504 IT Pros & Developers. It's quick & easy.

Limit in jQuery/DOM/Browser of 65540

P: 4
I am looking at jQuery as an alternative to an ASP.net Gridview for use in paging data to reduce database calls (I looked into ObjectDataSources as an alternative, but it seemed to take longer than the default paging due to the need to run the Row_Number function on each row before selecting the rows needed).

I am using the plugin found here: http://plugins.jquery.com/project/pagination

The dataset I am trying to load has about 198k records.
I am placing the rows into a table with display:none and cloning them into the SearchResult table.

If I only use the first 65,540 rows, it works like a dream, but if I try to use 65,541 rows, it does not work and does not report any errors.

Since this number is just slightly above the 16 bit limit, it seems unlikely that a variable limit is responsible, but then again, it is so close that it makes me wonder. Perhaps a browser limitation? I am using IE and Chrome with the same results.

Here is the javascript I am using to display different pages, for the plugin script, follow the link above.
Expand|Select|Wrap|Line Numbers
  1.     <script>
  2.  
  3.         function pageselectCallback(page_index, jq) {
  4.             $('#Searchresult').empty();
  5.             for(i=page_index * 500;i<(page_index * 500)+500;i++)
  6.             {
  7.                 var new_content = jQuery('#row_' + i).clone();
  8.                 $('#Searchresult').append(new_content);
  9.             }
  10.             return true;
  11.         }
  12.  
  13.         function initPagination() {
  14.             // count entries inside the hidden content
  15.             var num_entries = jQuery('#hiddenContent tr').length;
  16.             // Create content inside pagination element
  17.             $("#Pagination").pagination(num_entries, {
  18.                 callback: pageselectCallback,
  19.                 items_per_page: 500,
  20.                 load_first_page: true
  21.             });
  22.         }
  23.  
  24.         // When document is ready, initialize pagination
  25.         $(document).ready(function() {
  26.             initPagination();
  27.         });
  28.  
  29.  
  30.     </script>
  31.  
Thanks in advance for any help you may be able to provide.
Jun 23 '11 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.