I am using a "single" click event on a grid. If the user "double clicks" the grid instead of single click, then it is firing a 2nd event. I can see there are a lot of answers. Is there a preferred way to keep this from happening? I looked at solutions on Sencha's forums, but most of the answers go back to much earlier version of Extjs. Thanks for any help!
Announcement
Collapse
No announcement yet.
Double event firing on double click on a grid
Collapse
X
-
Typically, you would mask the grid or the body when the user clicks a row....assuming that you are making some sort of network request or swapping to a new screen. If masked, the second click would not cause an event to fire.
Alternately, you could "buffer" your itemclick listener:
Code:listeners : { itemclick : { scope : me, buffer : 300, fn : me.myMethod } }
Comment
-
This application is built in Sencha Architect. Should this code be added into a new "controller action" or into this one?
Code:onFileGrid_ItemClick: function(dataview, record, item, index, e, eOpts) { Ext.ComponentQuery.query('#filegrid')[0].rec = record; var ticket = record.get('DHDT#6'), whse = record.get('DHWHSE'), status = record.get('DHLINE'), doctyp = '#AFPDLVT'; pdfpanel = Ext.ComponentQuery.query('pdfpanel')[0]; me = this; if(status !== 'Released' && status !== 'Shipped'){ Ext.Msg.show({ title: 'Get BOL for Shipment', msg: 'Images for this BOL Are Not Yet Available', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); }else{ // var me = this; // Ext.getBody().mask(); Ext.Ajax.request({ scope : me, url : '/valence/vvcall.pgm', params : { pgm : 'nocstrace', action : 'get_Images', ticket : ticket, whse : whse, doctyp : doctyp }, success : function(response){ // Ext.getBody().unmask(); var r = Ext.decode(response.responseText); if(r.success === true){ var pdfWindow=Ext.create('NOCSTRACE.view.PDFwindow',{ title: 'NOCS BOL IMAGE DISPLAY' }).show(); var pdfpanel = Ext.ComponentQuery.query('pdfpanel')[0]; console.log(r.pdfurl); pdfpanel.removeAll(); pdfpanel.add({ xtype: 'component', autoEl: { tag: 'iframe', src: r.pdfurl, style: 'border:none;height:100%;width:100%' } }); }else{ Ext.Msg.show({ title: 'Get BOL for Shipment', msg: 'No Image Found', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); } }, failure: function(){ // Ext.getBody().unmask(); alert('an error occured'); } }); } }
Comment
Comment