cordova - undefined error while inserting data into table -
i trying insert db , display data in listview. getting error.
05-14 19:43:56.336: e/web console(1480): typeerror: result of expression 'c[0]' [undefined] not object. @ file:///android_asset/www/jquery_mobile/jquery.mobile-1.2.0.min.js:2
this trying do
function listdata(tx, resultset) { div = null; list = null; var row = null; list = $("<ul>").attr({ 'data-role' : 'listview', 'data-inset' : 'false', 'id' : 'mylist' }); count = resultset.rows.length; $(list).remove(); $.each(resultset.rows, function(index) { row = resultset.rows.item(index); var li = '<li><a href="#">' + row['date'] + '</a></li>'; list.append(li); }); div = '<div data-role="collapsible" data-inset="false" data-iconpos="right" data-collapsible="true" data-collapsed-icon="arrow-r" data-expanded-icon="arrow-d"><h3>' + row['name'] + '<span class="ui-li-count ui-btn-up-c ui-btn-corner-all" data-iconpos="right">' + count + '</span></h3></div>'; $(list).appendto(div).parent().appendto('[data-role="content"]').end().trigger("create"); $('div[data-role="collapsible"]').collapsible({ theme : 'a', refresh : true }); $('[data-role="listview"]').listview().listview('refresh'); }
can know why error getting?
thanks:)
you have specified $(list).remove()
remove whole <ul>
dom. need use list.html("");
Comments
Post a Comment