Closed NETvide closed 12 years ago
Are the divs set-up correctly on the new AJAX pages? Any AJAX page, if it has the right structure, will automatically get the iScroll object. See the documentation on the top of jqt.bars.js
The DIVs are correctly formatted but they are added to the current document, they display correctly except for the scrolling, However jqt.bars doesn't know about them because they were added after document.ready by the AJAX asynchronous return. Is there a call I can make to make jqt.bars initialise them correctly And add the scroll object or would you recommend a different technique of loading the arbitrary list of products and their details via AJAX.
As of 2011-03-20 jqt.bars.js uses the pageInserted event to add the iscroll object to new pages. See the doc on top of jqt.bars.js & lines 687 - 694. See the main_tabbar demo. Click on the AJAX tabbar icon and then on the Long GET Example. Also check in Safari's Web Inspector console to see if $('#dynamicPage').data('iscroll') exists.
Thanks for the suggestion above it enabled me to get a working, though may be not optimal solution using
for (var i = 0; i < Products.length; i++) {
$("#jqt").trigger("pageInserted", { page: $("#Product" + Products[i].Id) });
}
The exact scenario is
However I discovered that the environment failed if the pageInserted was triggered for each of the 200 plus pages but did work if I limited the call to the < 10 long pages which required scrolling to be enabled.
200 pages? two HUNDRED pages? TWO HUNDRED PAGES?!
You just ran out of memory.
In $(document).ready() we create 4 empty pages and fire off an AJAX request to collect the data to populate these pages and create further new pages containing more detailed information. What we're finding is that the <ul> contents of the initial 4 pages scrolls as expected but the contents of the new pages created from the AJAX data is fixed and doesn't scroll. Can you advise on a solution?