English 中文(简体)
就业增长出现在电网中
原标题:Empty rows appear in grid

I m试图建立一个电网(Ext.grid.Panel),并用数据填写。 但是,情况会错,因为电网显示无数据的空行。

模式是:

Ext.define( Order , {
    extend:  Ext.data.Model ,
    fields: [
        {
            name:  id ,
            type:  int 
        },
        {
            id:  companyId ,
            type:  int 
        },
        {
            id:  amount ,
            type:  int 
        },
        {
            id:  dealDate ,
            type:  date 
        },
        {
            id:  complete ,
            type:  int  //boolean imitation
        }
    ],
    idProperty:  id 
});

Grid & Store代码:

var orders = Ext.create( Ext.data.Store , {
    model:  Order ,
    proxy: Ext.create( Ext.data.proxy.Ajax , {
        url:  service/orders-data.php? ,
        reader: Ext.create( Ext.data.reader.Json , {
            root:  orders 
        })
    }),
    sorters: [{
        property:  name ,
        direction:  ASC 
    }]
});
orders.load();

var ordersGrid = Ext.create( Ext.grid.Panel , {
    width: 400,
    height: 300,
    store: orders,
    columns: [
        {
            text:  Amount ,
            dataIndex:  amount ,
            width: 120
        },
        {
            text:  Deal date ,
            dataIndex:  dealDate ,
            width: 120
        },
        {
            text:  Complete ,
            dataIndex:  complete ,
            width: 120
        }
    ]
});

服务器上的应急能力是:

{
"orders":[
    {
        "id":1,
        "amount":5000,
        "dealDate":"2012-01-05",
        "complete":0
    },
    {
        "id":2,
        "amount":6850,
        "dealDate":"2012-01-07",
        "complete":0
    },
    {
        "id":5,
        "amount":7400,
        "dealDate":"2012-01-09",
        "complete":0
    }
]
}

为什么电网显示空网?

最佳回答

你们所有模范领域,但第一个领域被宣布为有id性质,而应使用名称:

{
    name:  id ,
    type:  int 
},
{
    name:  companyId ,
    type:  int 
},
{
    name:  amount ,
    type:  int 
},
{
    name:  dealDate ,
    type:  date 
},
{
    name:  complete ,
    type:  int  //boolean imitation
}
问题回答

暂无回答




相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签