Results 1 to 3 of 3

Thread: Issue populating Grid Panel

  1. #1
    Sencha User
    Join Date
    Sep 2013
    Posts
    1

    Default Issue populating Grid Panel

    Hi,

    Would really appreciate help on this issue..

    We are using a GridPanel inside FormPanel and binding it to an arraystore. The data gets bound and displays correctly. However everytime the gird populates it throws the error below and the row selection gives null data.(Attached a notepad file that contians more elaborate code) Unable to get value of the property 'stopEditing': object is null or undefined

    Below is the sequence of code that we have used...
    1) Define a global grid variable--
    var grd_Overview_JobsReadyForImport;
    2) Reader
    var JobsReadyForImport = new Ext.data.ArrayReader({}, [
    { name: 'jobname' },
    { name: 'language' },
    { name: 'projectid' },
    { name: 'projectname' },
    { name: 'action' }
    ]);
    3) In the constructor populate the grid by setting the store

    grd_Overview_JobsReadyForImport.store = new Ext.data.Store({
    reader: JobsReadyForImport,
    data: allProjectsObj
    });
    4) Grid definition

    grd_Overview_JobsReadyForImport = new xg.GridPanel({
    id: 'grd_Overview_JobsReadyForImport',
    store: new Ext.data.Store({
    reader: reader,
    autoCommit: true,
    data: []
    }),
    cm: new xg.ColumnModel({
    defaults: {
    sortable: true
    },
    columns: [
    //sm,
    {header: "Author-it Job Name", sortable: true, dataIndex: 'jobname', width: 300 },
    { header: "Language Pair", sortable: true, dataIndex: 'language', width: 300 },
    { header: "Freeway Project ID", sortable: true, dataIndex: 'projectid', width: 200 },
    { header: "Freeway Project Name", sortable: true, dataIndex: 'projectname', width: 300 },
    //{ header: "Price", header: "Action", dataIndex: 'action' }
    {header: 'Action', sortable: false, renderer: function (val) { return '<input type="button" value="Import" id="' + val + '"/>'; }, dataIndex: 'action' }
    ]
    }),

    columnLines: true,
    stripeRows: true,
    autoscroll: true,
    //width: 600,
    height: 300,
    frame: true,
    //title: 'Freeway Details Grid with CheckBox Selection',
    iconCls: 'icon-grid'
    });

    Ext.getCmp('grd_Overview_JobsReadyForImport').getView().refresh();
    Attached Files Attached Files

  2. #2
    Sencha User slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    6,165

    Default

    Any chance you could post a stand-alone test case that doesn't have application specific code that would make it easier to run/test?

    Also, if you put the code in code tags (using the # button above) it well help make your posted code more readable.

  3. #3
    Sencha User
    Join Date
    Jun 2008
    Posts
    8

    Default

    Hi, you're calling grid.getView().refresh(); which invokes this.grid.stopEditing(true); where this.grid is undefined.
    It happends because this.grid.rendered == false at the moment.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •