1
0
Fork 0
mirror of https://github.com/koalyptus/TableFilter.git synced 2024-05-23 08:42:18 +02:00

Fix ezEditTable enter key hijaking

This commit is contained in:
Max Guglielmi 2015-07-19 22:43:18 +10:00
parent 82132308ae
commit 73b8dbcdae
6 changed files with 38 additions and 31 deletions

View file

@ -32,7 +32,7 @@
<p> <p>
To make the grid rows selectable, you need to import the To make the grid rows selectable, you need to import the
<a href="http://edittable.free.fr/zip.php?f=ezEditTable.zip&amp;p=1"target="_blank" title="ezEditTable is a javascript code aimed at enhancing regular HTML tables by adding features such as inline editing components, advanced selection and keyboard navigation - Developed by Max Guglielmi">ezEditTable</a> plugin, enable the <code>selectable</code> property <a href="http://edittable.free.fr/zip.php?f=ezEditTable.zip&amp;p=1"target="_blank" title="ezEditTable is a javascript code aimed at enhancing regular HTML tables by adding features such as inline editing components, advanced selection and keyboard navigation - Developed by Max Guglielmi">ezEditTable</a> plugin, enable the <code>selection</code> property
and configure the <code>advancedGrid</code> with the <a href="http://edittable.free.fr/zip.php?f=ezEditTable.zip&amp;p=1"target="_blank" title="ezEditTable is a javascript code aimed at enhancing regular HTML tables by adding features such as inline editing components, advanced selection and keyboard navigation - Developed by Max Guglielmi">ezEditTable</a> and configure the <code>advancedGrid</code> with the <a href="http://edittable.free.fr/zip.php?f=ezEditTable.zip&amp;p=1"target="_blank" title="ezEditTable is a javascript code aimed at enhancing regular HTML tables by adding features such as inline editing components, advanced selection and keyboard navigation - Developed by Max Guglielmi">ezEditTable</a>
options. options.
</p> </p>
@ -13045,7 +13045,7 @@
// Once ezEditTable dependency is installed in your // Once ezEditTable dependency is installed in your
// project import it by pointing to a local path: // project import it by pointing to a local path:
// vendor_path: 'path/to/ezEditTable' // vendor_path: 'path/to/ezEditTable'
selectable: true, selection: true,
default_selection: 'both', default_selection: 'both',
on_validate_row: function(o, row){ on_validate_row: function(o, row){
var country = o.Selection.GetActiveRowValues()[0]; var country = o.Selection.GetActiveRowValues()[0];

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -66,8 +66,7 @@ export default class AdapterEzEditTable {
cfg.base_path = cfg.base_path || tf.basePath + 'ezEditTable/'; cfg.base_path = cfg.base_path || tf.basePath + 'ezEditTable/';
var editable = cfg.editable; var editable = cfg.editable;
var selectable = cfg.selectable; var selectable = cfg.selection;
cfg.selection = selectable;
if(selectable){ if(selectable){
cfg.default_selection = cfg.default_selection || 'row'; cfg.default_selection = cfg.default_selection || 'row';
@ -348,7 +347,7 @@ export default class AdapterEzEditTable {
reset(){ reset(){
var ezEditTable = this._ezEditTable; var ezEditTable = this._ezEditTable;
if(ezEditTable){ if(ezEditTable){
if(this.cfg.selectable){ if(this.cfg.selection){
ezEditTable.Selection.Set(); ezEditTable.Selection.Set();
} }
if(this.cfg.editable){ if(this.cfg.editable){
@ -363,7 +362,7 @@ export default class AdapterEzEditTable {
destroy(){ destroy(){
var ezEditTable = this._ezEditTable; var ezEditTable = this._ezEditTable;
if(ezEditTable){ if(ezEditTable){
if(this.cfg.selectable){ if(this.cfg.selection){
ezEditTable.Selection.ClearSelections(); ezEditTable.Selection.ClearSelections();
ezEditTable.Selection.Remove(); ezEditTable.Selection.Remove();
} }

View file

@ -523,14 +523,18 @@ export class TableFilter{
this.isUserTyping = false; this.isUserTyping = false;
global.clearInterval(this.autoFilterTimer); global.clearInterval(this.autoFilterTimer);
} }
// if(o.ezEditTable){ // TODO: hack to prevent ezEditTable enter key event hijaking.
// if(o.editable){ // Needs to be fixed in the vendor's library
// o.ezEditTable.Editable.Set(); if(this.hasExtension('advancedGrid')){
// } var advGrid = this.extension('advancedGrid');
// if(o.selectable){ var ezEditTable = advGrid._ezEditTable;
// o.ezEditTable.Selection.Set(); if(advGrid.cfg.editable){
// } ezEditTable.Editable.Set();
// } }
if(advGrid.cfg.selection){
ezEditTable.Selection.Set();
}
}
}, },
// set focused text-box filter as active // set focused text-box filter as active
onInpFocus(e) { onInpFocus(e) {
@ -542,14 +546,18 @@ export class TableFilter{
Event.cancel(_ev); Event.cancel(_ev);
Event.stop(_ev); Event.stop(_ev);
} }
// if(o.ezEditTable){ // TODO: hack to prevent ezEditTable enter key event hijaking.
// if(o.editable){ // Needs to be fixed in the vendor's library
// o.ezEditTable.Editable.Remove(); if(this.hasExtension('advancedGrid')){
// } var advGrid = this.extension('advancedGrid');
// if(o.selectable){ var ezEditTable = advGrid._ezEditTable;
// o.ezEditTable.Selection.Remove(); if(advGrid.cfg.editable){
// } ezEditTable.Editable.Remove();
// } }
if(advGrid.cfg.selection){
ezEditTable.Selection.Remove();
}
}
}, },
// set focused drop-down filter as active // set focused drop-down filter as active
onSlcFocus(e) { onSlcFocus(e) {

View file

@ -10,7 +10,7 @@
<p> <p>
To make the grid rows selectable, you need to import the To make the grid rows selectable, you need to import the
{EZEDITTABLE_LINK} plugin, enable the <code>selectable</code> property {EZEDITTABLE_LINK} plugin, enable the <code>selection</code> property
and configure the <code>advancedGrid</code> with the {EZEDITTABLE_LINK} and configure the <code>advancedGrid</code> with the {EZEDITTABLE_LINK}
options. options.
</p> </p>
@ -68,7 +68,7 @@
// Once ezEditTable dependency is installed in your // Once ezEditTable dependency is installed in your
// project import it by pointing to a local path: // project import it by pointing to a local path:
// vendor_path: 'path/to/ezEditTable' // vendor_path: 'path/to/ezEditTable'
selectable: true, selection: true,
default_selection: 'both', default_selection: 'both',
on_validate_row: function(o, row){ on_validate_row: function(o, row){
var country = o.Selection.GetActiveRowValues()[0]; var country = o.Selection.GetActiveRowValues()[0];