注意数据格式,不是什么格式都能加载的 var data=[ {firstName: 'Ed', lastName: 'Spencer'}, {firstName: 'Tommy', lastName: 'Maintz'}, {firstName: 'Aaron', lastName: 'Conran'}, {firstName: 'Jamie', lastName: 'Avins'} ] store.loadData(data) loadData( data, [append] ) Loads an array of data straight into the Store.Using this method is great if the data is in the correct format already (e.g. it doesn't need to be processed by a reader). If your data requires processing to decode the data structure, use a MemoryProxy instead.Available since: 1.1.0Parameters data : Ext.data.Model[]/Object[] Array of data to load. Any non-model instances will be cast into model instances first. append : Boolean (optional) true to add the records to the existing records in the store, false to remove the old ones first.Defaults to: false
var data=[
{firstName: 'Ed', lastName: 'Spencer'},
{firstName: 'Tommy', lastName: 'Maintz'},
{firstName: 'Aaron', lastName: 'Conran'},
{firstName: 'Jamie', lastName: 'Avins'}
]
store.loadData(data)
loadData( data, [append] )
Loads an array of data straight into the Store.Using this method is great if the data is in the correct format already (e.g. it doesn't need to be processed by a reader). If your data requires processing to decode the data structure, use a MemoryProxy instead.Available since: 1.1.0Parameters
data : Ext.data.Model[]/Object[]
Array of data to load. Any non-model instances will be cast into model instances first.
append : Boolean (optional)
true to add the records to the existing records in the store, false to remove the old ones first.Defaults to: false