Sunday 15 February 2015

jquery mobile - AJAX nested listview emptied automatically? -


From tomorrow morning it's working and can not decide where the problem is ...

I have a master page (index.htm) which has a link that loads on my TV show list page (list.htm). In this list page, I load into an ensemble, resulting in an AJAX call on the page (Season. HTM), returns the show's season list.

If I extend expansion in list.htm, it has been shown to be standing back but when I try to expand it the content is removed.

Here is my sample code:

index.htm

  & lt; Html & gt; & Lt; Top & gt; & Lt; Meta charset = "UTF-8" & gt; & Lt; Link rel = "stylesheet" href = "http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css" /> & Lt; Script src = "http://code.jquery.com/jquery-2.1.1.min.js" & gt; & Lt; / Script & gt; & Lt; Script src = "http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js" & gt; & Lt; / Script & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; Div data-role = "page" & gt; & Lt; Ul data-roll = "list view" & gt; & Lt; Li & gt; & Lt; A href = "list.htm" & gt; TV show list & lt; / A & gt; & Lt; / Li & gt; & Lt; / Ul & gt; & Lt; / Div & gt; & Lt; / Body & gt; & Lt; / Html & gt;  

list .htm

  & lt; Html & gt; & Lt; Body & gt; & Lt; Div data-role = "page" & gt; & Lt; Ul data-roll = "list view" & gt; & Lt; Li class = "shows" data-role = "openable" & gt; & Lt; H2 & gt; Show Test & lt; / H2 & gt; & Lt; Ul data-roll = "list view" id = "show" & gt; & Lt ;! - Placeholder for Ajax Nested List View - & gt; & Lt; / Ul & gt; & Lt; / Li & gt; & Lt; / Ul & gt; & Lt; Script language = "javascript" & gt; $ (Document) .ready (function () {$ ('show'). ('Collapsibleexpand', function () {$ .ajax ({url: "season.htm", success: function (data) {$ ( "#show") Empty () .appand (data) .enhanceWithin (). Listview ("Refresh");}})}});}); & Lt; / Script & gt; & Lt; / Div & gt; & Lt; / Body & gt; & Lt; / Html & gt;  

Sessions HTML

  & lt; Html & gt; & Lt; Body & gt; & Lt; Li data-role = "openable" & gt; & Lt; H2 & gt; Season 1 & lt; / H2 & gt; & Lt; Ul data-roll = "list view" & gt; & Lt; Li & gt; & Lt; A href = "#" & gt; Remove season & lt; / A & gt; & Lt; / Li & gt;  

Whether empty () #show is applying for the child

< P> Thanks!

I'm finally using this code in list.htm:

  & lt; Html & gt; & Lt; Body & gt; & Lt; Div data-role = "page" & gt; & Lt; Ul data-role = "list view" & gt; & Lt; Li class = "show" data-role = "compressed" & gt; Test; & Lt; / H2 & gt; & Lt; Ul data-role = "list view" id = "show" & gt; & Lt ;! - Placeholder for Ajax Nested List View - & gt; & Lt; / Ul & gt; & Lt; / Li> & Lt; / Ul & gt; Script language = "javascript" & gt; $ (Document) .ready (function () {$ (".shows"). Capsapsible ({extension: work} {$ .ajax ({Url: "weather HTM", success: work (data) {.. $ ("# Show") HTML (Data) .enhanceWithin () List view ("Refresh");}})}}});}); & Lt; / Script & gt; & Lt; / Div & gt; & Lt; / Body & gt; & Lt; / Html & gt;  

No comments:

Post a Comment