Hi. In **Netzke Grid** I'm trying to execute some custom logic right after pressing the ok button at the confirmation window.
I just copy&paste the code located at netzke-basepack-0-8/lib/
netzke/basepack/grid/javascripts/event_handling.js, just like this getting the following error: this.deleteData is not a function...
js_configure do |c|
c.on_delete_action = <<-JS
function(record){
this.getSelectionModel().select(record);
this.onDel();
}
JS
c.on_del = <<-JS
function() {
Ext.Msg.confirm(this.i18n.confirmation, this.i18n.areYouSure, function(btn){
if (btn == 'yes') {
var records = [];
this.getSelectionModel().selected.each(function(r){
if (r.isNew) {
// this record is not know to server - simply remove from store
this.store.remove(r);
} else {
records.push(r.getId());
}
}, this);
if (records.length > 0){
if (!this.deleteMask) this.deleteMask = new Ext.LoadMask(this.getEl(), {msg: this.deleteMaskMsg});
this.deleteMask.show();
// call API
this.deleteData({records: Ext.encode(records)}, function(){
this.deleteMask.hide();
},
//////////////////////////
//Here: my custom logic!//
//////////////////////////
}
}, this);
}
JS
end
what I'm I doing wrong?
Thanks in advance.