webfriend13
3 Jul 2012, 1:07 AM
Hi All,
I have added a context menu on my grid. If user Right Clicks on a grid cell, I give him option to copy the content. Following is the code
var menuContext = new Ext.menu.Menu({
items: [{
icon: 'content/icons/copy.png',
text: 'Copy'
}],
listeners: {
click: function (menu, item, e, eOpts) {
var selModel = selGrid.getSelectionModel();
if (selModel.hasSelection()) {
var str;
var selColumnNum = selModel.nextSelection.column;
var selColumnField = selModel.nextSelection.record.fields.items[selColumnNum].name;
str = selModel.nextSelection.record.data[selColumnField];
if (window.clipboardData && clipboardData.setData) {
clipboardData.setData('text', str);
}
}
}
}
});
If user right clicks on the grid and then tries to sort the grid, I am getting "Microsoft JScript runtime error: 'viewIndex' is null or not an object" error.
When user clicks on sort, I am making an Ajax request and then I am binding data to store. using following code. Somewhere during this call, I am getting the error.
myGridStore.loadRawData(Ext.decode(responseData.responseText), false);
I have added a context menu on my grid. If user Right Clicks on a grid cell, I give him option to copy the content. Following is the code
var menuContext = new Ext.menu.Menu({
items: [{
icon: 'content/icons/copy.png',
text: 'Copy'
}],
listeners: {
click: function (menu, item, e, eOpts) {
var selModel = selGrid.getSelectionModel();
if (selModel.hasSelection()) {
var str;
var selColumnNum = selModel.nextSelection.column;
var selColumnField = selModel.nextSelection.record.fields.items[selColumnNum].name;
str = selModel.nextSelection.record.data[selColumnField];
if (window.clipboardData && clipboardData.setData) {
clipboardData.setData('text', str);
}
}
}
}
});
If user right clicks on the grid and then tries to sort the grid, I am getting "Microsoft JScript runtime error: 'viewIndex' is null or not an object" error.
When user clicks on sort, I am making an Ajax request and then I am binding data to store. using following code. Somewhere during this call, I am getting the error.
myGridStore.loadRawData(Ext.decode(responseData.responseText), false);