调试了很久,终于出来了。

  1. Ext.define('MyApp.views.lifechannelCombo', { 
  2.     extend: 'Ext.form.field.ComboBox'
  3.     alias:'widget.lifechannelCombo'
  4.      
  5.     id:'lifechannelCombo'
  6.     name:'channelname'
  7.     value:'channelid'
  8.     width: 180, 
  9.     fieldLabel: '推送渠道'
  10.     labelWidth: 60, 
  11.     emptyText: '请选择'
  12. queryMode:'local', //这个需要加上。。
  13.     store: new Ext.data.Store({ 
  14.         singleton : true
  15.         proxy: { 
  16.                 type: 'ajax'
  17.                 url : 'lifechannel!queryChannelid'
  18.                 actionMethods : 'post'
  19.                 reader: { 
  20.                     type: 'json'
  21.                     totalProperty: 'ChannelCount'
  22.                     root: 'root' 
  23.                 } 
  24.         }, 
  25.         fields:['channelid''channelname'], //不管有没有model,这个fields都必须写,而且只能写在这里,
  26. //在reader里面的话会报错"reader.read is not a function"
    //原因暂时不详
  27.         autoLoad:true 
  28.     }), 
  29.     loadingText:'正在加载数据,请稍侯……'
  30.     triggerAction:'all'
  31.     valueField:'channelid'
  32.     displayField:'channelname'
  33.  
  34.     initComponent: function() { 
  35.         var me = this
  36.         me.callParent(arguments); 
  37.     } 
  38. });