Ext下拉框图片+文字

来源:互联网 发布:淘宝店铺如何设置会员 编辑:程序博客网 时间:2024/06/06 08:28
  1. this.items = [  
  2.                       {  
  3.                           xtype: 'form',  
  4.                           bodyPadding   : '5 5 0',  
  5.                           items: [  
  6.                               {  
  7.                                     xtype: 'textfield',  
  8.                                     name : 'name',  
  9.                                     labelAlign  : 'right',  
  10.                                     fieldLabel: '<font color=red>*</font>按钮名称'  
  11.                               },  
  12.                               {  
  13.                                     fieldLabel  : '图标',  
  14.                                     xtype       : 'combobox',  
  15.                                     name        : 'icon',  
  16.                                     store       : Ext.create('Ext.data.Store',{  
  17.                                                     fields  : ['name''icon','value'],  
  18.                                                     autoLoad:true,  
  19.                                                     proxy   :{  
  20.                                                             type    :'ajax',  
  21.                                                             url     :  '../***/***/***/***/store/button/icon.json'//json的目录啦,或者是你远程的json也可以  
  22.                                                     },  
  23.                                                     reader  : {  
  24.                                                             type    : 'json'  
  25.                                                     }  
  26.                                                 }),  
  27.                                     labelAlign  : 'right',  
  28.                                     [b]tpl:'<tpl for="."><div x-boundlist-item:qtip="{icon}" class="x-boundlist-item"><img src="{icon}" width="16" height="16">&nbsp;{name}</div></tpl>'[/b],//zz这里的icon是你的图片的具体路径,不要搞错哦,我这里是通过上面的那个json获得图片路径的  
  29.                                     displayField: 'name',  
  30.                                     valueField  : 'value',  
  31.                                     editable    : false,  
  32.                                     multiSelect : false                               
  33.                               }  
  34. ]
原创粉丝点击