destroy: function (options) {
var data = JSON.stringify(options.data.models);
data = data.replace('[','').replace(']','');
alert(data);
/*$.ajax({
url: '".$url."',
data: {data: data},
success: function (result) {
alert(result);
$('#show_msgs').html(result);
}
});*/
},
他执行标准并移动以完全摧毁数据源,直到他从网格中消失,但是当我点击另一个项目以删除我在销毁数据源时所注意到的数据来访问数据时它带来的值上一项,下面的代码如下:
{name: 'excluir',text: '',title: '', className: 'bt-excluir',imageClass: 'k-icon k-delete',
click: function(e) {
var grid = this;
var fields = grid.dataSource.options.schema.model.fields;
var tr = $(e.target).closest('tr');
var data = this.dataItem(tr);
var model = grid.dataItem(grid.select());
var array = {};
$.each(fields, function (idx, elem) {
if(elem.type === 'date'){
model[idx] = kendo.toString(model[idx],'yyyy-MM-dd');
}
if(elem.type === 'datetime'){
model[idx] = kendo.toString(model[idx],'yyyy-MM-dd HH:mm:ss');
}
array[idx] = model[idx];
});
var data = JSON.stringify(array);
window.content(template(data));
window.open().center();
$('.k-confirm-true').click(function(){
alert(model.toSource());
grid.dataSource.remove(model);
model.set('selected',!1);
delete model.selected;
grid.clearSelection();
grid.dataSource.sync();
window.close();
})
$('.k-confirm-false').click(function(){
window.close();
})
}
},
这是destroy中的第一个警报(数据)的结果:
[{id_estadio:4, nome_estadio:"Ninfa IV", borrifa:"\x01"}]
这是destroy中的secod警报(数据)的结果:
[{id_estadio:4, nome_estadio:"Ninfa IV", borrifa:"\x01"}, {id_estadio:3, nome_estadio:"Ninfa III", borrifa:"\x01"},]
并且只需点击一个按钮,它就会传递该行的相应项目!</ p>