2014-10-31 177 views
1

我在显示数据网格1管理员和2 - 标准 对电网应用列表过滤器上显示1和2 我需要显示“admin”和“标准”列表过滤

支票影像:enter image description here

代码:

{  text: 'UserType', dataIndex: 'UserTypeId', groupable: true, 
         filter: { 
          type: 'list', active: true 
         }, 
         renderer: function (value) { 
          if (value == 1) { 
           return "Admin"; 
          } 
          else 
           return "Standard"; 
         } 
        }, 

回答

1
   {  
       text: 'UserType', dataIndex: 'UserTypeId', groupable: true, 
        filter: { 
         type: 'list', active: true, 
         options: [1,'Admin', 2,'Standard'] 
        }, 
        renderer: function (value) { 
         if (value == 1) { 
          return "Admin"; 
         } 
         else 
          return "Standard"; 
        } 
       }, 

它的工作

0

嗨请以下配置添加到您的过滤器,以使其显示过滤器根据需要

 {  
      text: 'UserType', dataIndex: 'UserTypeId', groupable: true, 
         filter: { 
          type: 'list', active: true, 
          options: ['Standard', 'Admin'] 
         }, 
         renderer: function (value) { 
          if (value == 1) { 
           return "Admin"; 
          } 
          else 
           return "Standard"; 
         } 
        }, 

查询here in docs欲了解更多信息,请帮助您。