把省份与城市以树的形式输出
Ext.lib.Ajax.request(
'POST',
'/Index/mainIndex',
{ success: function (data) {
data.respOnseText= "{pros:" + data.responseText + "}"; //获取后台回调的省份城市JSON格式数据
var respOnse= Ext.util.JSON.decode(data.responseText);
var province = new Ext.XTemplate(
'
',//遍历读取pros
'{id}--{text}
',
'',//遍历读取pros下的children
'{id}--{text}
',
'',
''
);
province.compile();
province.append("Div2", response);
}
}
);