PDA

View Full Version : me.store is null error occured when the grid panel is recreated



rushi2440
19 Apr 2012, 1:05 AM
hi.. sencha forum member I am having one problem with recreating the gridPanel.

I am getting me.store is null and the window comes but with empty data.

I am having taskganttpanel contained in taskwindow. So I load the store from the taskWindow beforeShow event only. Below is my taskWindow code

Ext.define('rms.view.projectmgt.taskAdd' ,{
extend: 'Ext.Window',
alias : 'widget.taskaddwindow',
id: 'taskaddwindow',
title: 'Task Management Window',
width: '85%',
height: '85%',
closeAction: 'destroy',
closable : true,
modal: true,
constrain: true,
maximizable: true,
stateful: false,
projectid: null, // this will be set before showing window
layout: 'border',

initComponent: function() {

this.layoutConfig = {
align: 'stretch'
};
this.items = [
{
region: 'center',
xtype: 'taskpanel',
//html: 'taskpanel',
width: '85%',
height: '85%'
}
];
this.on({
scope: this,
beforeshow: this.onBeforeShow
});
this.callParent(arguments);

},
onBeforeShow: function() {
var projectid = this.projectid;
if(projectid != null) {
var store = Ext.data.StoreManager.lookup('task');
console.log('BEFOR SHOW ::'+projectid);
store.load({
params: {'projectid': projectid},
callback: function(options, success, response) {
console.log('RESPONSE FROM SERVER :'+response.responseText);
} //callback
});

var dependencyStore = Ext.data.StoreManager.lookup('dependency');
dependencyStore.load();
}
}
});


the window popup comes correctly and the data projectid is also passed correctly to server to query all the task related to project.

But don't able to understand for some reason gives me me.store is null error

My taskWindow has taskganttPanel with beforeload function checking the projectid is null or not, below is my code

beforeload: function(store,records,options) {
console.log('BEFORE LOAD YAAR panel'+records.params);
console.log('BEFORE LOAD YAAR panel PROJECTID '+records.params['projectid']);
if(records.params['projectid'] != null)
{
return true;
}
else
{
return false;
}
}


please suggest me what's wrong why I am getting me.store is null error, even though my store perfectly load the store with containing data.

Yogendra Singh
Sr. Programmer
Kintudesigns.com

scottmartin
19 Apr 2012, 6:29 AM
I see you are using StoreManager to find your stores.
Do you your store defines have storeId: 'storename' defined?

Have you put a watch on your code to see what is happening ..
using the call stack to find where the call is originating?

Your error is me.store, but I do not see a reference in your code .. meaning you have not provided much detail or the line/function that it errors out.

I see you are using 'id' for your window. Is it possible that a 2nd instance of the window is causing the problem?

You will need to provide a bit more detail after you research a bit more.

Regards,
Scott.