-
20 May 2011 4:46 AM #1
How does it work? Itemclick and itemdblclick
How does it work? Itemclick and itemdblclick
Hello,
i´m testing ext 4.0.1. Now I have a problem with a grid in an border-layout.
When i make a double-click on a row the itemclick event is fired twice before the dblclick event.
How can I achieve that both events work properly? And how can I call the method test / test2 to perform some actions?
Thanks in advance
HTML Code:Ext.define('TestGrid', { extend: 'Ext.grid.Panel', alias: 'widget.testgrid', itemId: 'mandant', initComponent: function(){ contextMenu = Ext.create('Ext.menu.Menu', { items: [ { text: 'regular item 1', id: 'one', iconCls: 'add' }, { text: 'regular item 2', id: 'two' }, { text: 'regular item 3', id: 'three' } ] }); Ext.apply(this, { fieldLabel: 'Blubb', delay: 100, columnLines: true, store: store, selType: 'rowmodel', columns: [ { text : 'Name', sortable : true, dataIndex: 'company', flex: 1 }, { text : 'Name', sortable : false, hidden: true, dataIndex: 'price', width: 100 } ], viewConfig: { stripeRows: true, listeners: { itemcontextmenu: function(view, rec, node, index, e) { e.stopEvent(); contextMenu.showAt(e.getXY()); return false; }, itemdblclick: function(view, rec, node, index, e) { console.info('dblclick'); this.panel.test2(); }, itemclick: function(view, rec, node, index, e) { console.info('click'); this.panel.test(); } } } }); TestGrid.superclass.initComponent.apply(this, arguments); }, rowcontextmenu: function(grid, rowIndex, e){ this.contextMenu.showAt(e.getXY()); }, test: function(){ alert('click'); }, test2: function(){ alert('dbl'); } });
-
20 May 2011 5:36 AM #2
i have a same problem.
when i found a solution, i share it with uLast edited by ajaxvador; 20 May 2011 at 5:38 AM. Reason: no
Vador
-
22 May 2011 10:32 PM #3
Does no one have an idea how to split these two events?

-
23 May 2011 1:42 PM #4
working on same issue. no luck so far. If someone has found this please post I will do the same
cheers
-
16 Apr 2012 2:24 AM #5
itemclick and itemdblclick together issue
itemclick and itemdblclick together issue
Hi All,
I too am hunting and waiting for some miracle to be created by sencha to make itemclick and itemdblclick work simulataneously.
My observations are -
If we have an alert statement in the procedures being called on itemclick and itemdblclick, both the events work as expected to.
But on removal of the alert statement it behaves badly, itemclick works but itemdblclick gives errnous results.
Can some one help all of us.
Regards
-
6 Nov 2012 11:57 AM #6
Solution
Solution
Finally found a solution:
This seems to solve the problem and allow the dblclick function to be called.Code:treepanel.on("itemclick", function(view, record, item, index) { //function },this,{delay:300,buffer:true}); treepanel.on("itemdblclick", function(view, record, item, index) { //function });
-
6 Nov 2012 12:49 PM #7
-
6 Nov 2012 2:23 PM #8
The problem I had was that if the itemclick event was defined, then the itemdblclick event was never fired.
If you needed them to fire mutually exclusively, you could add some code to stop the itemclick event from firing if the itemdblclick event was fired in the last 300ms.
-
4 Feb 2013 8:20 AM #9
Wrong approach.
Wrong approach.
You don't need to use itemclick and itemdblclick events.
Use select and itemdblclick eventswww.codelighter.com
There are 10 types of people in this world, those who understand binary and those who dont


Reply With Quote

