baig / jquerymobile-editablelistview

A jQuery Mobile Plugin with an intuitive UI to add new list items and remove existing ones.
http://wasifbaig.com/jquerymobile-editablelistview/
Other
36 stars 16 forks source link

Programmatically Appending List Items #1

Closed ghost closed 10 years ago

ghost commented 10 years ago

I'm using Cordova, and trying to append to the list programmatically, using: $('#list').append("<li>item</li>");

Unfortunately, behavior seems to be dependent on the timing of the call. If I try to append after the entire page is loaded, the list fails to register it as an item. In particular, if I append during a the "deviceready" event, it adds to the list fine, however, if I call it during a "pagebeforeshow", it adds the item to the list container visually - but not the list itself.

I've attached screenshots to demonstrate what I mean. Notice, that after clicking edit, the items not belonging to the list disappear. Before clicking edit: beforeclickingedit After clicking edit: afterclickingedit

The error is replicable.

On a side note: The style issue in the screenshots, where the plus is not inline with the textbox seems to only occur in the iOS simulator, and not on the device - so I do not believe it is an issue.