Format Store in Ext

来源:互联网 发布:2016淘宝客推广教程 编辑:程序博客网 时间:2024/04/30 14:44

A store configuration would be something like:

var store = new Ext.data.ArrayStore({    // store configs    autoDestroy: true,    storeId: 'myStore',    // reader configs    idIndex: 0,      fields: [       'company',       {name: 'price', type: 'float'},       {name: 'change', type: 'float'},       {name: 'pctChange', type: 'float'},       {name: 'lastChange', type: 'date', dateFormat: 'n/j h:ia'}    ]});

This store is configured to consume a returned object of the form:

var myData = [    ['3m Co',71.72,0.02,0.03,'9/1 12:00am'],    ['Alcoa Inc',29.01,0.42,1.47,'9/1 12:00am'],    ['Boeing Co.',75.43,0.53,0.71,'9/1 12:00am'],    ['Hewlett-Packard Co.',36.53,-0.03,-0.08,'9/1 12:00am'],    ['Wal-Mart Stores, Inc.',45.45,0.73,1.63,'9/1 12:00am']];
 store.loadData(myData);