欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

一個(gè)簡(jiǎn)單的Ext.XTemplate的實(shí)例代碼

 更新時(shí)間:2012年03月18日 14:38:23   作者:  
把省份與城市以樹(shù)的形式輸出的Ext.XTemplate的實(shí)例代碼,需要的朋友可以參考下
把省份與城市以樹(shù)的形式輸出
復(fù)制代碼 代碼如下:

Ext.lib.Ajax.request(
'POST',
'/Index/mainIndex',
{ success: function (data) {
data.responseText = "{pros:" + data.responseText + "}"; //獲取后臺(tái)回調(diào)的省份城市JSON格式數(shù)據(jù)
var response = Ext.util.JSON.decode(data.responseText);
var province = new Ext.XTemplate(
'<tpl for="pros">',//遍歷讀取pros
'<p>{id}--{text}</p>',
'<tpl for="children">',//遍歷讀取pros下的children
'<p style="margin-left:10px;">{id}--{text}</p>',
'</tpl>',
'</tpl>'
);
province.compile();
province.append("Div2", response);
}
}
);

相關(guān)文章

最新評(píng)論