【发布时间】:2013-01-08 07:17:43
【问题描述】:
正如标题所说,我该怎么做?,我正在使用jiri创建的这个按钮:
How do i create a delete button on every row using the SlickGrid plugin?
当我在函数中添加 if(confirmation(msg)) 时,它会重复我的 msg ALOT 可能是因为我每次修改都会刷新表格。
问我是否需要更多信息,我在 stackoverflow 中仍然是菜鸟:P (如果有某种方式可以“杀死”该功能)
这是按钮,我正在使用(链接)我添加了 idBorrada 以检查 id 是否已被删除并且不要尝试删除它两次,这里也是一个确认,但是当我触摸取消时它再次询问我。
$('.del').live('click', function(){
var me = $(this), id = me.attr('id');
//assuming you have used a dataView to create your grid
//also assuming that its variable name is called 'dataView'
//use the following code to get the item to be deleted from it
if(idBorrada != id && confirm("¿Seguro desea eleminarlo?")){
dataView.deleteItem(id);
Wicket.Ajax.ajax({"u":"${url}","c":"${gridId}","ep":{'borrar':JSON.stringify(id, null, 2)}});
//This is possible because in the formatter we have assigned the row id itself as the button id;
//now assuming your grid is called 'grid'
//TODO
grid.invalidate();
idBorrada= id;
}
else{
};
});
,我再次调用整个函数。 希望对您有所帮助,抱歉语法不是我的母语
【问题讨论】:
-
,以便我们帮助您,我们真的要查看代码的相关部分。 span>
-
自从你说你是新的,请阅读Jon Skeet's Check List发布一个好问题。 span>
-
好的,我必须训练如何发布代码:/
标签: javascript jquery slickgrid