n00b
12 Aug 2011, 2:27 PM
Hi,
Here is my code
itemclick: function( view, rec, node, index, e, options ) {
Ext.Ajax.request({url: "ajax.php?type=Read&zid="+rec .internalId,success:function(resp){MyPanel1.loadRecord(Ext.decode(resp.responseText));}});
},
itemdblclick: function( view, rec, node, index, e, options ) {
if( Ext.getCmp("MIRT"+rec.internalId) == undefined ) {
Ext.Ajax.request({url: "ajax.php?type=Read&zid="+rec .internalId,success:function(resp){
var reponse = Ext.decode(resp.responseText);
MyTabz.add({ id:"MIRT"+reponse.id, title:"stuff", iconCls: "tabs",html:"more stuff" , closable: true,layout:"fit" }).show();
}});
}
}
These 2 listeners apply on a grid. They basically "work".
But (there's a but, otherwise I won't post !), the code inside the itemclick listener also executes when I doubleclick on a row...So basically, itemclick ALWAYS execute when itemdblclick runs.
So my ajax query always executes twice... on a double click... Which is annoying
Is it a flaw in my code, is it a extjs bug ? Is it something that can't be fixed due to javascript engine (I use chrome).
Thanks for your answsers.
Here is my code
itemclick: function( view, rec, node, index, e, options ) {
Ext.Ajax.request({url: "ajax.php?type=Read&zid="+rec .internalId,success:function(resp){MyPanel1.loadRecord(Ext.decode(resp.responseText));}});
},
itemdblclick: function( view, rec, node, index, e, options ) {
if( Ext.getCmp("MIRT"+rec.internalId) == undefined ) {
Ext.Ajax.request({url: "ajax.php?type=Read&zid="+rec .internalId,success:function(resp){
var reponse = Ext.decode(resp.responseText);
MyTabz.add({ id:"MIRT"+reponse.id, title:"stuff", iconCls: "tabs",html:"more stuff" , closable: true,layout:"fit" }).show();
}});
}
}
These 2 listeners apply on a grid. They basically "work".
But (there's a but, otherwise I won't post !), the code inside the itemclick listener also executes when I doubleclick on a row...So basically, itemclick ALWAYS execute when itemdblclick runs.
So my ajax query always executes twice... on a double click... Which is annoying
Is it a flaw in my code, is it a extjs bug ? Is it something that can't be fixed due to javascript engine (I use chrome).
Thanks for your answsers.