1.后台返回传一个泛型集合List<xxx>
public ActionResult AddCarMsg()
        {
            List<Brand> brands = BrandManager.GetAllBrand();
            ViewData["brands"] = Json(brands);
            return View();
        }2.前台要把brands绑定到combobox上
非关键代码省略:
............. var LeaveForm = new Ext.FormPanel({
                width: 360,
                frame: true,
                renderTo: AddCarMsg,
                title: "添加车辆信息",
                bodyStyle: "padding:5px 5px 0",
                id: "addCarForm",
                items: [
          {
              xtype: "combo",
              name: 'brand',
              store: //这里应该如何绑定?              fieldLabel: "品牌",
              emptyText: '请选择品牌'          },
.............请教

解决方案 »

  1.   

      Brand类  里面有多个属性, 你可以用Json数据,或者你可以输出[{name:"name"}] 等,可以解决  在store 时候  用render解析就可以
      

  2.   

    store 首先要有请求的url地址 
    还要给他一个reader ,让它知道如何去阅读返回的数据
      

  3.   

    能不能详细点,后台有没什么方法能将集合直接转为Json的,还有render怎么解析啊 ,谢谢啦,我是Ext新手
      

  4.   

      额 ,   如果是放在combo里面,因为只有一个属性值   你可以用out.println(Json格式的数据)   
    在前台 store的url指向这个地址     
        就可以,  Json格式数据 如:[{name:"张三"},{name:"李四"}]  
      

  5.   

    var findAllUserStore = new Ext.data.JsonStore({
    autoLoad:true,
    proxy:new Ext.data.HttpProxy({
    url:"findAllUser.action"
    }),
    fields:["name"]
    });xtype:"combo",
    emptyText:"选择网络客服",
    id:"myweb",
    mode:"remote",
    selectOnFocus:true,
    loadingText:"正在加载数据",
    triggerAction:"all",
    displayField:"name",
    store:findAllUserStore