PDA

View Full Version : Dleting the grid state



kamalakarreddy vancha
5 Feb 2015, 9:37 PM
Hi...
I am able to saving the grid state and deleting the grid state.
Everything is working fine.
But in deleting the grid state...
If i have the row numbers in grid i am getting the error like TypeError: el is null ext-all-debug.js:32457(only in the case of grid have the row number).
Otherwise its working fine.
Help me in this.
Here is my code to delete the grid state.


resetStateCmc:function(){ var me = this;
var satandardState = me.getState();
var paramObj = {
gridId : this.gridId || this.id,
gridCd : me.down('#gridCdItemId').getValue(),
userId : Modules.GlobalVars.loginUserId
};
me.mask('Deleting state...');
try {
Ext.Ajax.request({
url : 'gridstate/deleteGridStateDtls',
method : 'POST',
params : paramObj,
success : function(response) {
delete Modules.GlobalVars.gridStatObj[paramObj.gridId];
me.reconfigure(me.getStore(),me.originalColumns);
me.view.refresh();
me.down('#gridCdItemId').reset();
me.unmask();
},
failure : function() {
me.view.refresh();
me.unmask();
}


});
} catch (e) {
console.log(e.message);
Ext.getBody().unmask();
}
},




Modules.GlobalVars.gridStatObj


"{"
columns ":[{"
width ":24,"
header ":" & #160;"},{"
dataIndex ":"
exitMode ","
width ":55,"
header ":"
Exit Mode "},{"
dataIndex ":"
intViaNo ","
hidden ":true,"
width ":100,"
header ":" & #160;"},{"dataIndex":"curLocInd","hidden":true,"width":100,"header":"&# 160;
"}]}"



Please help me in this...



Thanks In Advance
Kamalakar

joel.watson
9 Feb 2015, 3:15 PM
Hi--

Could you put together a test case demonstrating the issue you're experiencing? If you can post a runnable test case here or, ideally, create a Fiddle (https://fiddle.sencha.com), I'll be happy to test this along with you.

Thanks!
Joel

steffenk
15 Feb 2015, 4:00 AM
This is the way i do



resetGrid: function() {
var target = this.getTarget();

// Clear the state.
Ext.state.Manager.clear(target.stateId);

// EXTJS-BUG:
// We need to reset the counter since we want the same column-id's
// generated again.
target.getView().headerCt.headerCounter = 0;

target.reconfigure(null, target.initialConfig.columns || Ext.getClass(target).prototype.columns);

// EXTJS-BUG:
// We need to skip the first state save after reconfiguration.
// (Ext-js stores the old state after reconfigure... )
target.on({
beforestatesave: function() {
return false;
},
single: true
});
}

joel.watson
15 Feb 2015, 7:08 AM
This is the way i do



Thanks for sharing that code, but are you able to put together a runnable test case that demonstrates this? Please use https://fiddle.sencha.com (https://fiddle.sencha.com).

Thanks
Joel

steffenk
15 Feb 2015, 9:45 AM
sry, no time for that. This is a part of a running and productive app.