PDA

View Full Version : cell editing plugin beforeedit event is not firing



drgaryholland
5 Jan 2016, 12:31 PM
I have a tabbed panel with a data grid. I have a cell editing plugin and an event listener for before edit event. When I double click a cell this event is not firing. Any help would be appreciated.


xtype: 'panel', height: 803,
width: 1280,
autoScroll: true,
title: 'Build Schedule',
tabConfig: {
xtype: 'tab',
maxWidth: 200,
width: 200
},
dockedItems: [
{
xtype: 'gridpanel',
cellRenderer: function(string, value) {


if (!string|| string === ''){
return '<span style="color:black">' + value + ' </span>';
}




//value = Ext.util.Format.date(value); //IE 8 Doesn't like Date Format






var ar = string.split('~');




if (ar[3] == "Y" ){
//return '<span style="background-color: #DBDBDB; color:' + value0 + '">' + value + ' </span>';
return '<span style="background-color:' + ar[0] + '">' + value + ' </span>';
}else{
//return '<span style="color:' + value0 + ';">' + value + '</span>';
return '<span style="background-color:' + ar[0] + '">' + value + ' </span>';
}




return value;


},
dock: 'bottom',
height: 800,
id: 'crosstabGridPanel',
width: 1280,
autoScroll: true,
title: 'Build Schedule Table',
columnLines: true,
enableColumnHide: false,
enableColumnMove: false,
enableColumnResize: false,
sortableColumns: false,
store: 'CrosstabStore',
viewConfig: {
height: 800,
id: 'crosstabGridView',
width: 1280,
loadingText: 'Loading Build Schedule...',
listeners: {
beforeitemcontextmenu: {
fn: me.onCrosstabGridViewBeforeItemContextMenu,
scope: me
},
containercontextmenu: {
fn: me.onCrosstabGridViewContainerContextMenu,
scope: me
},
itemmouseenter: {
fn: me.onCrosstabGridViewItemMouseEnter,
scope: me
}
}
},
plugins: [
Ext.create('Ext.grid.plugin.CellEditing', {
pluginId: 'endItemCellEditorPlugin',
listeners: {
beforeedit: {
fn: me.onCellEditingBeforeEdit,
scope: me
}
}
})

jdkhamba
5 Jan 2016, 2:26 PM
It is highly unusual to use dockeditems config for inserting a gridpanel as it is usually an array of buttons is used for displaying menus is used for docking at the top and for pagination when the docking is done at the bottom. A working example for what you are trying to do:

https://fiddle.sencha.com/#fiddle/1383

Maybe the usage of dockeditems is causing an issue. Also i do not see any columns config on your grid, which is where the editor is defined. Another possibility is the presence of cellrenderer, but I am just guessing.

drgaryholland
5 Jan 2016, 3:22 PM
Thanks for the response, I actually used Sencha Architect to construct this app. I left out the columns because there are approx 60 of them.The plugin worked fine before I added two additional tabs to the panel without touching the code on tabs that were already there.

jdkhamba
5 Jan 2016, 3:46 PM
Are there multiple grids with the same grid definition? Then the id "endItemCellEditorPlugin"
is probably being used by multiple grids and it is causing some kind of clash. Try removing the id and let extjs generate the id and see if that works.

On a side note, I am curious, is there a specific reason you are using sencha architect? Won't writing the code yourself give much more flexibility?