-
17 Feb 2013 8:23 AM #821
Ext.grid.livegrid.CheckboxSelectionModel mouse and keyboard events called twice
Ext.grid.livegrid.CheckboxSelectionModel mouse and keyboard events called twice
Ext.grid.livegrid.CheckboxSelectionModel mouse and keyboard events called twice
How to Reproduce:
Load the Checkbox demo in the livegrid source and either click on a row or try moving up and down rows with the arrow keys. Moving up and down results in skipping a record each time and clicking with the mouse only allows certain actions to take place because mousedown and keyup are being called twice each time.
Problem:
Red text represents the problem and green text represents the added code to solve it.
Line 68 of Ext.grid.livegrid.CheckboxSelectionModel.js
and line 64 of Ext.grid.livegrid.RowSelectionModel.jsCode:initEvents : function() { this.skipParentInitEvents = true; Ext.ux.grid.livegrid.CheckboxSelectionModel.superclass.initEvents.call(this); this.grid.view.on('reset', function(gridView, forceReload) { this.headerCheckbox = new Ext.Element( gridView.getHeaderCell(this.grid.getColumnModel().getIndexById(this.id)).firstChild ); if (this.markAll && forceReload === false) { this.headerCheckbox.addClass('x-grid3-hd-checker-on'); } }, this); Ext.grid.CheckboxSelectionModel.prototype.initEvents.call(this); },
Because of these three superclass calls the Ext.ux.grid.livegrid.RowSelectionModel.superclass gets called twice resulting in Ext.grid.RowSelectionModel.initEvents being called twice and the mousedown and keyup events being doubled.Code:initEvents : function() { if(!this.skipParentInitEvents){ Ext.ux.grid.livegrid.RowSelectionModel.superclass.initEvents.call(this); } var grid = this.grid, view = grid.view, store = grid.store; view.on('rowsinserted', this.onAdd, this); store.on('selectionsload', this.onSelectionsLoad, this); store.on('load', this.onStoreLoad, this); },
Solution:
By adding a flag for skipping the superclass initEvents, the CheckboxSelectionModel can still call both superclasses without worry of the double event hooks.
-
20 Feb 2013 1:47 PM #822
Can you add a column locking feature to your live grid, or at least point me in the right direction to get something working? I purchased a developers license a few months ago.
Thanks!
-
6 Mar 2013 3:33 PM #823
I've upgraded to 3.4 and have seen some strange behavior of live grid but only on IE....sometimes only ten rows populate in a grid and there is empty space where it should have added more visible row...any ideas...works fine in FF and Chrome
-
7 Mar 2013 12:41 AM #824
i had something similar and fixed it as follows:
Code:liveBufferUpdateFirstTime:true, // private liveBufferUpdate : function(records, options, success) { if (success === true) { this.adjustBufferInset(); this.fireEvent('buffer', this, this.ds, this.rowIndex, Math.min(this.ds.totalLength, this.visibleRows-this.rowClipped), this.ds.totalLength, options ); // this is needed since references to records which have been unloaded // get lost when the store gets loaded with new data. // from the store this.grid.selModel.replaceSelections(records); this.isBuffering = false; this.isPrebuffering = false; this.showLoadMask(false); if (this.requestQueue >= 0) { var offset = this.requestQueue; this.requestQueue = -1; this.updateLiveRows(offset); return; } if (this.isInRange(this.rowIndex)) { this.replaceLiveRows(this.rowIndex, options.forceRepaint); } else { this.updateLiveRows(this.rowIndex); } if (this.liveBufferUpdateFirstTime) { this.liveBufferUpdateFirstTime=false; this.layout(); } return; } else { this.fireEvent('bufferfailure', this, this.ds, options); } this.requestQueue = -1; this.isBuffering = false; this.isPrebuffering = false; this.showLoadMask(false);Extensions:
Ext.ux.DatePickerPlus (Multimonth,Multiselect,...)
Ext.ux.menu.StoreMenu - Ajax Store as menu-item config
Extended Window - Aero Shadows, nested grayscaled modal windows
Ext.MessageBox.promptCombo/promptRadio/promptCheckbox
Ext.ux.plugin.triggerfieldTooltip (for Comboboxes, Datefields...)
Ext.util.MD5
Ext.util.Utf8 (encode/decode)
Ext.util.base64 (encode/decode)
Using:
ExtJS 3.4.1.1/4.2
XPsp3/W7sp1
IE8/9/10
FF 20
Chrome 26


Reply With Quote