Extjs GridPanel 幾點說明

1. 在Ext中,表格控件必須包含列定義信息,並指定表格的數據存儲器。列信息由columns定義,而數據存儲器有store定義。

2. store負責把各種各樣的原始數據(JSON對象數組等等)轉換成Ext.data.Record類型的對象。

    包含兩部分的信息:proxy和reader。proxy指定獲取數據的方式,reader是指如何解析這一堆數據。

簡單store 模板代碼

var store = Ext.data.Store({
	proxy : {
		type : "ajax",
		url : "",
		reader : {
			type : "json",
			totalProperty : "count",
			root : "root",
			idProperty : "id"
		}
	},
	fields : [
		{name : 'id', mapping : "id"},
		{name : 'name', mapping : "name"},
		{name : "desc", mapping : 'description'}
	]
});


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章