javascript - How to order SQLite database alphabetically -
i have sqlite database in french utf-8 encoding , trying organize categories in alphabetical order. setup looks like: http://i.imgur.com/cqnw1es.png
i tried add select distinct category 'main database' order name
unfortunately did not display correctly. can tell me correct way alphabetize category
column in abc order?
javascript:
function ondeviceready() { if (window.device.platform === 'ios' && parsefloat(window.device.version) >= 7.0) statusbar.overlayswebview(false); db = window.sqliteplugin.opendatabase({name: "treatfinder", bgtype: 1}); db.transaction(function(tx){ tx.executesql("select distinct category 'main database'",[],function(tx,res){ //console.log("number of categories: " + res.rows.length); var len = res.rows.length; (var i=0; < len; = + 1) { $("#allrepos").append("<li><a href='treatsymptoms.html?category=" + res.rows.item(i).category + "'>" + res.rows.item(i).category + "</a></li>"); } $('#allrepos').listview('refresh'); }); })
Comments
Post a Comment