我想删除一个带有按钮的行。我有以下代码:
depAgregarButton.addEventListener('click', function(e){
dataBase('insert', depNamesField.value );
var databaseObj = new dataBase('query', null),
data = [];
for(var i in databaseObj ){
var row = Ti.UI.createTableViewRow({
title: databaseObj[i],
backgroundColor:'#FFF',
height: '35dp'
});
var label = Ti.UI.createLabel({
color: '#727072',
objName: 'label',
text: databaseObj[i],
touchEnabled: false,
left: '12dp',
width: '250dp',
font: {
fontSize:'12dp',
fontFamily:'HelvLight Regular'
}
});
var buttonDelete = Ti.UI.createButton({
backgroundImage: '/images/but_x.png',
width:'30dp',
height:'30dp',
right: '8dp',
clickName:'button'
});
data.push(row);
row.add(label);
row.add(buttonDelete);
};
table.appendRow(row);
});
我正在向表中添加行,但我不知道如何使用 deleteButton 删除每一行