Sep 14, 2012, 11:49 AM
[CLOSED] CheckColumn Interceptor Function
Hi,
Related to this thread http://forums.ext.net/showthread.php...n-in-GridPanel I'm migrating this to Ext.NET 2.1.
This is the final JS code that we implement:
Related to this thread http://forums.ext.net/showthread.php...n-in-GridPanel I'm migrating this to Ext.NET 2.1.
This is the final JS code that we implement:
onBeforeRender: function () {
Ext.ux.CheckColumn.prototype.onMouseDown = Ext.ux.CheckColumn.prototype.onMouseDown.createInterceptor(myInterceptor);
},
myInterceptor: function (e, t) {
if (this.editable && t.className && Ext.fly(t).hasClass("x-grid3-cc-" + this.dataIndex)) {
var rIndex = this.grid.getView().findRowIndex(t);
var record = this.grid.store.getAt(rIndex);
var cIndex = record.fields.keys.indexOf(this.dataIndex);
var titulo = record.data[record.fields.items[1].name];
var total = record.data[record.fields.items[2].name];
if (record.fields.items[1].name == this.dataIndex)
titulo = !titulo;
if (record.fields.items[2].name == this.dataIndex)
total = !total;
if (!(titulo || total)) {
record.data[record.fields.items[3].name] = false;
}
return (cIndex == 3 && (titulo || total)) || cIndex != 3;
}
return false;
},
Right now, how can I use the interceptor? If you could tell me this, migrate the other function will be easy.
Last edited by Daniil; Sep 25, 2012 at 6:58 AM.
Reason: [CLOSED]