2013-02-20 77 views
0

使用Kendo网格时,打开过滤器选项会给出第一个操作员焦点。我明白这个我很有用,当有多个操作符时,但我只允许包含操作符,所以想要第一个值框有焦点。Kendo UI网格过滤器自动对焦

我该怎么办?

回答

0

如果要限制过滤器选项:

  • 添加额外的:假
  • 仅定义你想要的运营商

代码示例:

$('#grid').kendoGrid({ 
    dataSource: dataSource, 
    height: '240px', 
    columns: [ 
     { field: 'Id' }, 
     { field: 'Number', title: 'Employee #' }, 
     { field: 'First', title: 'FirstName' }, 
     { field: 'LastName', title: 'LastName' }, 
     { 
      field: 'FunctionCode', title: 'Function', filterable: { 
       extra: false, 
       operators: { 
        string: { 
         eq: "Is equal to", 
         neq: "Is not equal to" 
        } 
       } 
      } 
     } 
    ] 
}); 

见剑道UI Grid运行演示here
并参见this页面为例。