Note that there are some explanatory texts on larger screens.

plurals
  1. POA workaround to fix an IE bug with respect to the clone() method in jquery 1.3.2
    primarykey
    data
    text
    <p>I am using the Jquery pagination plugin <br></p> <p><a href="http://plugins.jquery.com/project/pagination" rel="nofollow noreferrer">http://plugins.jquery.com/project/pagination</a> <br></p> <p>to paginate the rows in a table.</p> <p>I also use a little tip provided in another SO question <a href="https://stackoverflow.com/questions/1523163/jquery-pagination-plugin/1523265#1523265"> here </a> to correct a bug in the original example...</p> <p>The code is working fine in FireFox and Chrome but not in IE6+... Here is my javascript to initialize and run the pagination...</p> <pre><code>function pageselectCallback(page_index, jq){ var items_per_page = pagination_options.items_per_page; var offset = page_index * items_per_page; var new_content = $('#hiddenresult tr.result').slice(offset, offset + items_per_page).clone(); $('#Searchresult').empty().append(new_content); return false; } var pagination_options = { num_edge_entries: 2, num_display_entries: 8, callback: pageselectCallback, items_per_page:3 } /** * Callback function for the AJAX content loader. */ function initPagination() { var num_entries = $('#hiddenresult tr.result').length; // Create pagination element $("#Pagination").pagination(num_entries, pagination_options); } // Load HTML snippet with AJAX and insert it into the Hiddenresult element // When the HTML has loaded, call initPagination to paginate the elements $(document).ready(function(){ initPagination(); }); </code></pre> <p>The Table structure is </p> <pre><code>// Table to display the paginated data &lt;table&gt; &lt;tr&gt; &lt;td&gt; &lt;div id="Pagination" class="pagination"&gt; &lt;/div&gt; &lt;br style="clear:both;" /&gt; &lt;div id="Searchresult" style="height:auto;"&gt; This content will be replaced when pagination inits. &lt;/div&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; // Table containing the rows that are to be paginated &lt;table id="hiddenresult" style="display:none;"&gt; &lt;tr&gt; &lt;td&gt; &lt;table&gt; &lt;tr&gt; // 1st row &lt;td&gt; &lt;table&gt; &lt;tr&gt; &lt;td&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;table&gt; &lt;thead&gt; &lt;tr&gt; &lt;/tr&gt; etc... &lt;/thead&gt; &lt;tbody&gt; &lt;tr&gt; &lt;/tr&gt; etc etc... &lt;/tbody&gt; &lt;/table&gt; &lt;/td&gt; &lt;/tr&gt; // end 1st row &lt;tr&gt; //2nd row &lt;td&gt; &lt;table&gt; &lt;tr&gt; &lt;td&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;table&gt; &lt;thead&gt; &lt;tr&gt; &lt;/tr&gt; etc... &lt;/thead&gt; &lt;tbody&gt; &lt;tr&gt; &lt;/tr&gt; etc etc... &lt;/tbody&gt; &lt;/table&gt; &lt;/td&gt; &lt;/tr&gt; //end 2nd row etc etc etc.... &lt;/table&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; // id = "hiddenresult" </code></pre> <p>The way i see it the plugin get's initialized in IE but the bug is in displaying the paginated rows... But cannot figure out where it is or how to correct it... Thanks a lot for your suggestions....</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload