Results 1 to 2 of 2

Thread: My GridPanel won't load data from Store

  1. #1
    Sencha Premium Member
    Join Date
    Jul 2009
    Posts
    137

    Default My GridPanel won't load data from Store

    I'm not able to get my GridPanel to load data from its Store. I have other working GridPanels, but for some reason something about this one won't work. The Store's reader contains the remote JSON data, but it's not getting into the GridPanel. Here is the code:

    Code:
     
    var JobNotesStoreConfig = {
    storeId: "JobNotesStore",
    url: "/json/JobNotes.json",
    baseParams: {
    RepairID: ""
    },
    reader: new Ext.data.JsonReader({
    id: "NoteID",
    roots: "rows",
    totalProperty: "totalRows",
    idProperty: "NoteID"
    }, [
    {name: "NoteID", type: "int"},
    {name: "NoteDate", type: "date", dateFormat:"Y-m-dTh:i:s"},
    {name: "NoteUser", type: "string"},
    {name: "NoteText", type: "string"}
    ])
    };
     
    Ext.onReady(function(){
     
    var JobNotesGrid = new Ext.Panel({
    id: "JobNotesGrid",
    xtype: "grid",
    renderTo: document.body,
    frame: false,
    cls: "PanelBorder",
    store: new Ext.data.Store(JobNotesStoreConfig),
    height: 70,
    width: 370,
    hideHeaders: true,
    hidden: true,
    disableSelection: true,
    trackMouseOver: false,
    deferRowRender: false,
    columns: [
    {header: "Date", dataIndex: "NoteDate", width: 100, renderer: NoteDate},
    {header: "User", dataIndex: "NoteUser", width: 80},
    {header: "Text", dataIndex: "NoteText", width: 180, renderer: NoteText}
    ],
    bbar: new Ext.PagingToolbar({
    id: "JobNotesPagingBar",
    xtype: "paging",
    pageSize: 2,
    store: Ext.StoreMgr.get("JobNotesStore"),
    displayInfo: true,
    displayMsg: "Displaying {0} - {1} of {2} <b>Job Notes</b>",
    emptyMsg: "No Job Notes",
    style: "border:none"
    })
    });
     
    JobNotesGrid.show();
    JobNotesGrid.store.load({params:{start:0, limit:2, RepairID:0}});
     
    });

  2. #2
    Sencha Premium Member
    Join Date
    Jul 2009
    Posts
    137

    Default Never mind, I figured it out

    Typo: 'roots' instead of 'root'

Posting Permissions

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