Apr 30, 2013, 9:14 AM
[CLOSED] How to pass grid data(id and it's records) to event handler of store's load event?
Hi ,
I want to pass grid reference to load event of it's store.
I have tried below code ...but it is throwing error "Microsoft JScript runtime error: 'records' is undefined".
following way I am attaching event handler to store...
I want to pass grid reference to load event of it's store.
I have tried below code ...but it is throwing error "Microsoft JScript runtime error: 'records' is undefined".
following way I am attaching event handler to store...
listeners: {
load: {
fn: SelectGoalOrg(this, records, successful, eOpts)
}
}
complete code is as below....
Ext.create("Ext.grid.Panel", {
store: {
model: Ext.define("App.LevelModel" + levelID, {
extend: "Ext.data.Model",
fields: [
{
name: "Organization_Id",
mapping: "Organization_Id",
type: "int"
}, {
name: "Organization_Desc",
mapping: "Organization_Desc",
type: "string"
},
{
name: "Org_Level_Id",
mapping: "Org_Level_Id",
type: "string"
},
{
name: "Level_Number",
mapping: "Level_Number",
type: "int"
},
{
name: "Org_Level_Desc",
mapping: "Org_Level_Desc",
type: "string"
},
{
name: "Operating_Group_Id",
mapping: "Operating_Group_Id",
type: "int"
},
{
name: "Next_LevelID",
mapping: "Next_LevelID",
type: "int"
},
{
name: "Next_LevelName",
mapping: "Next_LevelName",
type: "string"
}
],
idProperty: "Organization_Id"
}),
storeId: "LevelStore" + levelID,
autoLoad: true,
readParameters: function (operation) {
return {
apply: {
"regionCSV": region,
"level": levelNumber
}
};
},
proxy: {
type: "ajax",
reader: {
type: "json",
root: "data"
},
url: '@(Url.Action("GetOrgsWithLevelInfo", "Talent"))'
},
listeners: {
load: {
fn: SelectGoalOrg(this, records, successful, eOpts)
}
}
},
id: "grdLevel_" + region + "_" + levelID,
border: false,
cls: "grd-existing-goals",
height: 280,
renderTo: "div_" + region + "_" + levelID,
width: 210,
columns: {
items: [{
width: 160,
dataIndex: "Organization_Desc",
text: levelName
}
]
},
emptyText: "No records found. Please select a region to see related business units",
selModel: window.App.chkLevelSelect = Ext.create("Ext.selection.CheckboxModel", {
proxyId: "chkOrgsSelect" + levelID,
selType: "checkboxmodel",
listeners: {
deselect: {
fn: function (item, record, index) {
if (!this.deselectLock) {
OrgDeselect(this, record, index);
}
}
},
select: {
fn: function (item, record, index) {
if (!this.selectLock) {
OrgSelect(this, record, index);
}
}
}
},
checkOnly: true
}),
selectionMemory: false
});
Last edited by Daniil; Apr 30, 2013 at 2:19 PM.
Reason: [CLOSED]