Extjs Ext js弹出窗口如何使其工作?活动链接
我怎样才能让它工作 我想把删除图标放在我的网格中,就像一个带有弹出窗口的columnaction来确认一样。 是否要删除x项 做了这样的东西,但它不起作用Extjs Ext js弹出窗口如何使其工作?活动链接,extjs,grid,popup,action,messagebox,Extjs,Grid,Popup,Action,Messagebox,我怎样才能让它工作 我想把删除图标放在我的网格中,就像一个带有弹出窗口的columnaction来确认一样。 是否要删除x项 做了这样的东西,但它不起作用 { xtype: 'actioncolumn', width: 50, items: [ { icon: 'delete.gif', // Use a URL in
{
xtype: 'actioncolumn',
width: 50,
items: [
{
icon: 'delete.gif', // Use a URL in the icon config
tooltip: 'Delete Product',
handler: function (grid, rowIndex, colIndex) {
var rec = store.getAt(rowIndex);
var id = rec.get('ID');
Ext.MessageBox.show({
title: 'Save Changes?',
msg: 'Do you want to delete ' + rec.get('Name') + ' ?',
buttons: Ext.MessageBox.OKCANCEL,
fn: showResult
});
}
}
]
}
使用
确认
而不是显示
:
Ext.MessageBox.confirm('Save Changes?', 'Do you want to delete ' + rec.get('Name') + ' ?', function(r) {
if (r == 'yes') {
rec.destroy();
}
});
使用
确认
而不是显示
:
Ext.MessageBox.confirm('Save Changes?', 'Do you want to delete ' + rec.get('Name') + ' ?', function(r) {
if (r == 'yes') {
rec.destroy();
}
});
对于“取消”按钮:
handler: function (grid, rowIndex, colIndex) {
var rec = grid.store;
Ext.MessageBox.show({
title: 'Address',
msg: 'Do you want to delete ?',
buttons: Ext.MessageBox.OKCANCEL,
fn: function showResultText(btn) {
if (btn == 'ok') {
rec.removeAt(rowIndex);
}
}
});
}
对于“取消”按钮:
handler: function (grid, rowIndex, colIndex) {
var rec = grid.store;
Ext.MessageBox.show({
title: 'Address',
msg: 'Do you want to delete ?',
buttons: Ext.MessageBox.OKCANCEL,
fn: function showResultText(btn) {
if (btn == 'ok') {
rec.removeAt(rowIndex);
}
}
});
}
谢谢,但是有没有制作OkCancel按钮的选项?谢谢,但是有没有制作OkCancel按钮的选项?