extjs combobox

时间:2023-03-10 07:46:27
extjs combobox

states.js中

Ext.example.states=[

['AL','ALabama','The Heart of Dixie'],

['AK','Alaska','The Land of the Midnight Sun'],

['','',''],

/*...*/

/*...*/

]

combobox 中:

Ext.onReady(function (){

  Ext.QuickTips.init();

  //simple array store

  var store =new Ext.data.SimpleStore

   ({

      fields:['abbr','state','nick'],

      data:Ext.exampledata.states //上面的simpledata

   }),

   var combo=new Ext.form.ComboBox   /*里面是一个config*/

    ({

    store:store,

    displayField:'state',

    typeAhead:true,

    mode:local,

    triggerAction:'all',

    emptyText:'Select a state...',

    selectOnFocus:true,

    applyto:'local-states'    /**/

    })

})