[CLOSED] How to pass grid data(id and it's records) to event handler of store's load event?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    [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...
     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]

Similar Threads

  1. Replies: 0
    Last Post: Sep 11, 2012, 5:14 PM
  2. Replies: 1
    Last Post: Jun 28, 2012, 9:39 PM
  3. Replies: 1
    Last Post: Jun 26, 2012, 1:40 PM
  4. Replies: 5
    Last Post: Jun 25, 2012, 6:19 PM
  5. [CLOSED] Pass value to event handler
    By CSG in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Apr 08, 2009, 11:28 AM

Posting Permissions