dev_java
10 Sep 2010, 12:53 AM
Hi,
I have a Store which contains some records. This store is being used by a grid. On clicking the Load button, a new window is opened and the grid is rendered in that new window.
Before rendering the window, i have to add one more record to the start (first position) of the Store.
I tried using store.insert() api. but it failed to insert and it gave an Error message in Error Console
Error: managed is not defined
Source File: http://localhost:8080/EMSpro/extjs/ext-all.js
Line: 7
dataStore = new Ext.data.Store({
id: 'dataStore ',
proxy: new Ext.data.HttpProxy(
new Ext.data.Connection({
url:'../emspro/getData.htm'
})
),
reader:new Ext.data.JsonReader({
fields: [
'data','type'
]
})
});
data_Grid = Ext.extend( Ext.grid.GridPanel, {
border: true
,id: 'data_Grid'
,initComponent:function() {
var config = {
store: dataStore,
columns: [
{header: "type", width:350, dataIndex: 'type'}
],
};
Ext.apply(this, Ext.apply(this.initialConfig, config));
data_Grid .superclass.initComponent.apply(this, arguments);
}
,onRender:function() {
data_Grid .superclass.onRender.apply(this, arguments);
}
});
Ext.reg('data_Grid ', data_Grid );
Code for beforeshow listener of Window:
listeners:{
'beforeshow':function(){
var data_Value = dataStore.recordType;
var b = new data_Value({
clli:'A' ,
type:'A' ,
});
dataStore.insert(0, b); //when i add this line to code error is shown
}
}
I have posted this unknowingly in Ext 2.x Help forum. Sorry for that.
Thank You.
I have a Store which contains some records. This store is being used by a grid. On clicking the Load button, a new window is opened and the grid is rendered in that new window.
Before rendering the window, i have to add one more record to the start (first position) of the Store.
I tried using store.insert() api. but it failed to insert and it gave an Error message in Error Console
Error: managed is not defined
Source File: http://localhost:8080/EMSpro/extjs/ext-all.js
Line: 7
dataStore = new Ext.data.Store({
id: 'dataStore ',
proxy: new Ext.data.HttpProxy(
new Ext.data.Connection({
url:'../emspro/getData.htm'
})
),
reader:new Ext.data.JsonReader({
fields: [
'data','type'
]
})
});
data_Grid = Ext.extend( Ext.grid.GridPanel, {
border: true
,id: 'data_Grid'
,initComponent:function() {
var config = {
store: dataStore,
columns: [
{header: "type", width:350, dataIndex: 'type'}
],
};
Ext.apply(this, Ext.apply(this.initialConfig, config));
data_Grid .superclass.initComponent.apply(this, arguments);
}
,onRender:function() {
data_Grid .superclass.onRender.apply(this, arguments);
}
});
Ext.reg('data_Grid ', data_Grid );
Code for beforeshow listener of Window:
listeners:{
'beforeshow':function(){
var data_Value = dataStore.recordType;
var b = new data_Value({
clli:'A' ,
type:'A' ,
});
dataStore.insert(0, b); //when i add this line to code error is shown
}
}
I have posted this unknowingly in Ext 2.x Help forum. Sorry for that.
Thank You.