Jul 11, 2013, 10:25 AM
[CLOSED] Gridpanel ItemContextMenu Handler function not giving current rowindex for inserted row
Hi
following is the script for ItemContextMenu Handler function
The issue faced is when we do a rightclick on a dynamically added row we do not get the rowindex (it's shown as undefined).
For existing rows / normal rows we get rowindex.
following is the script for ItemContextMenu Handler function
var onContextMenu = function (e, currentRecord, contextmenu) {
rowindex = currentRecord.index;
...
...
}
And following is the function calling lineHtml.X().GridPanel()
...
...
.Listeners(l =>
{
l.ItemContextMenu.Handler = "onContextMenu(e,this.store.getAt(index),#{ContextMenu})";
}
)
There is another function on contextmenu item click which dynamically adds new row to the gridvar onClick = function (ctrl, text) {
if (text == "xyz") {
// Create a model instance
var storeData = ....;
var r = Ext.create('Modelnm', storeData);
var storeSt = Ext.getStore('Storenm');
storeSt.insert(rowindex, r);
App.PriceEntryGrid.editingPlugin.startEditByPosition({ row: rowindex, column: 0 });
return false;
}
The issue faced is when we do a rightclick on a dynamically added row we do not get the rowindex (it's shown as undefined).
For existing rows / normal rows we get rowindex.
Last edited by Daniil; Jul 12, 2013 at 5:16 AM.
Reason: [CLOSED]