在下面的函数中,我渲染了一个选择框。我不确定如何明智地从数据库代码中提取选项,这些选项将集成到现有代码中......谢谢。
function renderDrinks_Mixer(menucat2)
{
$('#tblDrink').empty();
db.transaction(function(tx)
{
tx.executeSql('SELECT * FROM Menu where f_objmenucat2="'+ menucat2 +'"', [],
function(tx, results)
{
var len = results.rows.length, i;
for (i = 0; i < len; i++) {
var len = results.rows.length, i;
for (i = 0; i < len; i++) {
$('#tblDrink').append('<tr class="simpleCart_shelfItem">'
+'<td class="pcont"><span class="item_category" style="display:none">'+ results.rows.item(i).category +'</span><h3><span class="item_name">'+ results.rows.item(i).drinkname +'</span></h3>'
+'<p>'+ results.rows.item(i).desc +'</p></td>'
+'<td align="center" cellpadding="0" cellpadding="0">'
+'<select data-theme="f" name="'+ results.rows.item(i).drinkname +'" data-iconpos="notext" data-icon="Plus" data-native-menu="true" id="stringselect">'
//#### HELP HERE -PULL OPTIONS FROM DB, NOT SURE HOW TO INTEGRATE ####/
+'</select>'
+'</td>'
+'</tr>').trigger('create');
}
}
}
, null);
}
);
}