Results 1 to 9 of 9

Thread: EXTJS Gridpanel not show data

  1. #1

    Exclamation EXTJS Gridpanel not show data

    I have used a Gridpanel in a Tabpanel, it doesn't show data, though the data are founded in firebug, why? I have checked many times, but still no solution... pls help me!



    --------------
    myData=Ext.grid.dummyData=[];
    myReader = new Ext.data.ArrayReader([{name: 'Kartentyp'},{name: 'Karte'},{name: 'Blattname'},{name: 'Bestellnummer'}]);

    myStore = new Ext.data.GroupingStore({
    reader:myReader,
    data: myData,
    autoDestroy: true,
    sortInfo:{field: 'Kartentyp', direction: "ASC"},
    groupField:'Karte' });

    myGridPanel = new Ext.grid.GridPanel({
    store: myStore,
    colModel: new Ext.grid.ColumnModel({
    defaults: {
    width: 200,
    sortable: true},

    columns: [
    {header: "Karte", width: 60, sortable: true, dataIndex: 'Karte',hidden :true},
    {header: "Blattname", width: 200, sortable: true, dataIndex: 'Blattname'},
    {id:'Bestellnummer',header: "Bestellnummer", width: 200, sortable: true, dataIndex: 'Bestellnummer'},
    {header: "Kartentyp", width: 40, sortable: true, dataIndex: 'Kartentyp',hidden :true}]}),

    view: new Ext.grid.GroupingView({
    forceFit:true,
    groupTextTpl: '{text} ({[values.rs.length]}{[values.rs.length > 1 ? "Items" : "Item"]})'
    }),
    frame:true,
    width: 400,
    Height: 400,
    autoScroll:true,
    collapsible: true,
    title: 'Anfrage Ergebnisse',
    iconCls: 'icon-grid',
    renderTo: 'result'
    });

    myData.push([kartentyp,karte,blattname,bestellnummer]);
    myStore.loadData(myData);
    myGridPanel.render(Ext.getDom('result'));

    ------------

    Thanks!

  2. #2
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,890

    Default

    I assume that dummyData is not really [] in your code.

  3. #3

    Default

    still not understand, in firebug could all data right be showed, that means the data are already be accessed, or?

  4. #4
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,890

    Default

    Code:
    myData=Ext.grid.dummyData=[];
    myReader = new Ext.data.ArrayReader([{name: 'Kartentyp'},{name: 'Karte'},{name: 'Blattname'},{name: 'Bestellnummer'}]);
    
    myStore = new Ext.data.GroupingStore({
    reader:myReader, 
    data: myData,
    autoDestroy: true,
    sortInfo:{field: 'Kartentyp', direction: "ASC"},
    groupField:'Karte' });
    You are loading an empty array.

  5. #5

    Default

    thank you first!

    but
    myData=Ext.grid.dummyData=[]; // to initialize


    then later

    myData.push([kartentyp,karte,blattname,bestellnummer]);

    myStore.loadData(myData);


    I thought that the data can be later loaded, it's also our request, at begin in the tabpanel should other information be showed.
    So must the data per event be loaded und dynamish showed.

  6. #6
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,890

    Default

    Quote Originally Posted by hentobali View Post
    thank you first!

    but
    myData=Ext.grid.dummyData=[]; // to initialize


    then later

    myData.push([kartentyp,karte,blattname,bestellnummer]);

    myStore.loadData(myData);


    I thought that the data can be later loaded, it's also our request, at begin in the tabpanel should other information be showed.
    So must the data per event be loaded und dynamish showed.
    If the variables kartentyp, karte, blattname and bestellnummer are defined, that looks like it should work.

  7. #7
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,890

    Default

    Why are you rendering if you are using a TabPanel? Didn't you read the docs?

  8. #8

    Default

    yes, the variables kartentyp, karte, blattname and bestellnummer are already defined.

    we use drei tabs in one tabpanel, only in one tab will one Gridpanel be used, in other two not.

    what have i wrong done?

  9. #9

Posting Permissions

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