Results 1 to 2 of 2

Thread: ExtJS4/SharpKit.NET Grid store/model showing empty row(s)

  1. #1
    Sencha User
    Join Date
    Nov 2010
    Posts
    9

    Default ExtJS4/SharpKit.NET Grid store/model showing empty row(s)

    My problem is very similar to this question:
    but in a bit difference in syntax & behaviour, I've spent day(s) to solve by trying in many ways but failed.
    Please note that: i must keep the SharpKit.NET generation behavior by calling parent constructor instead of json field construction, like the code bellow

    Ext.define("Core.Scripts.model.Book", { extend: "Ext.data.Model", fields: ["title", "pages"] // Do not use this});Ext.define("Core.Scripts.model.Book", { extend: "Ext.data.Model", constructor: function () { this.callParent([{ fields: ["title", "pages"] }]); // Use this }});This is link to my simplified version on jsfiddle http://jsfiddle.net/thanhptr/LqXan/. Bellow is my copied code, this code still does not fix:

    Ext.define("Core.Scripts.model.Book", { extend: "Ext.data.Model", constructor: function () { this.callParent([{ fields: ["title", "pages"] }]); }});Ext.define("Core.Scripts.store.Store", { extend: "Ext.data.Store", constructor: function () { this.callParent([{ model: "Core.Scripts.model.Book", data: [ { title: "book 1", pages: 10 }, { title: "book 2", pages: 20 } ] }]); }});Ext.define("Core.Scripts.view.GridPanel", { extend: "Ext.grid.Panel", constructor: function () { this.callParent([{ store: new Core.Scripts.store.Store(), region: "center", columns: [ { header: "title", dataIndex: "title" }, { header: "pages", dataIndex: "pages" } ] }]); }});Ext.define("Core.Scripts.view.DetailViewport", { extend: "Ext.container.Viewport", constructor: function () { this.callParent([{ frame: true, layout: "border", items: [new Core.Scripts.view.GridPanel()] }]); }});Ext.onReady(function () { var viewPort = new Core.Scripts.view.DetailViewport();});
    I already posted my question to stackoverflow.com at: http://stackoverflow.com/questions/1...ing-empty-rows

  2. #2
    Sencha User
    Join Date
    Feb 2013
    Location
    California
    Posts
    11,985
    Answers
    506

    Default

    Managed to get it working by pulling the constructor from your model:
    Code:
    Ext.define("Core.Scripts.model.Book", {
        extend: "Ext.data.Model",
        fields: ["title", "pages"]
    });

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
  •