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);
}
}
);