jquery-archive / jquery-mobile

jQuery Mobile Framework
https://jquerymobile.com
Other
9.69k stars 2.41k forks source link

List Display and Ajax #222

Closed ghost closed 13 years ago

ghost commented 13 years ago

When using data-role="listview" on an unordered list that will have list items injected via Ajax, the list items does not get styled and thus the resulting list view is never rendered. One note on this, the unordered list is part of the initial view/page and the list items get's injected after an Ajax call triggered from a button click event.

Expected outcome: http://jquerymobile.com/demos/1.0a1/#docs/lists/lists-ul.html

Current result: Only the ul tag is styled.

naton commented 13 years ago

Could you just check if it works with single words? I have related troubles with list items containing spaces, not styling though (just events).

ghost commented 13 years ago

Could you expand on that a little more, or is there perhaps a bug you logged?

naton commented 13 years ago

I'm still investigating it a bit, I think there are some assumptions at line 2270 that I'm not understanding fully: parent.contents()[ 0 ].nodeValue.split("\n")[0] would mean that I can't use, say, linked text and try to do a split button list? The examples uses one word with no links on all list levels but the last - is this the only markup supported at this time?

(I'm new here, feel free to guide me elsewhere, I'll try to file a bug if that's what's expected)

ghost commented 13 years ago

Naton, this is different enough from my problem that I believe it warrants a bug report. Just hit Create Issue top left and add one. I did look at that line of code but I guess one needs to see it in the greater context of the listview plugin.

naton commented 13 years ago

Thanx, I filed a report (#252) and even think I found a solution to it :)

ghost commented 13 years ago

Awesome, I will have a look over at the bug report

scottjehl commented 13 years ago

Fixed with refresh method in http://github.com/jquery/jquery-mobile/commit/962d5a137b23a4f8382266f27cba784a128ab15f

phillpafford commented 13 years ago

I'm having a similar issue when adding dynamic elements: https://github.com/jquery/jquery-mobile/issues/1213