Extjs combox的异步加载

很多朋友用 extjs  很多时候都要用到combo 而异步加载是用的最多的 今天我就举一个例子 了解combo的异步加载

Ext.onReady(function () {    

Ext.BLANK_IMAGE_URL = "/Scripts/resoures/images/default/s.gif";    

var sotre = new Ext.data.JsonStore({       

  autoLoad: true,        

 proxy: new Ext.data.HttpProxy({             url: 'Text.aspx'         }),    

     reader: new Ext.data.JsonReader({             fields: [{ name: 'id' }, { name: 'peovince'}],           

  root: 'root'         })     });   

  var form = new Ext.form.FormPanel({        

frame: true,        

border: true,        

300,        

height: 200,   

renderTo: Ext.getBody(),       

  items: [{            

xtype: 'combo',      

       id: 'com',         

    fieldLabel: '书籍列表',       

      store: sotre, //设置数据源    

         displayField: 'peovince',      

       valueField: 'id',       

      mode: 'remote',       

      triggerAction: 'all',     

        selectOnFocus: true,       

      allowBlank: false,        

     editable: false         }]

    });

});

注意加载的时候 要注意设置加载模式 本地还是异步 已经设置  autoLoad: true,      这个属性 很重要

有很多梦想是遥不可及的,除非你坚持
原文地址:https://www.cnblogs.com/wuhanly/p/4133274.html