0
我試圖根據特定數據庫字段的內容顯示或隱藏按鈕。我將該字段定義爲'文本',因爲該字段可能包含類似1-1或1-20或0的字段。如果字段(arref1)不等於0,那麼我想顯示我的按鈕。否則,隱藏按鈕。以下是我有這麼遠,但忽略了最低工作:顯示或隱藏基於數據庫中字段內容的按鈕
var resultRule = db.execute('SELECT arref1 FROM genrules WHERE title="'+client+'"');
if (resultRule!='0') {
var appliedRule1 = Ti.UI.createButton({
title:' Applied Rule ' + rows.fieldByName('arref1') + '',
bottom:120,
left: 80,
width: 'auto',
height:40,
borderRadius:5,
textAlign: 'center',
color:'#FFFFFF',
backgroundColor:'#7b4336',
backgroundSelectedColor:'#cc9933',
backgroundImage: 'NONE',
font:{fontSize:'20dp'}
});
win.add(appliedRule1);
appliedRule1.addEventListener('click',function(e)
{
var win = Ti.UI.createWindow({
url: 'appliedruledetail.js',
title:' Applied Rule' + rows.fieldByName('arref1') + ''
});
var client = '' + rows.fieldByName('genrule') + '' ;
win.client = client;
Ti.UI.currentTab.open(win);
}
);
} else{};
我認爲我們已經得到了郵件在同一時間。即將回答此問題;) –
非常感謝,我瞭解了ResultSet並與他們合作。 – dnevels