当前位置: 代码迷 >> Web前端 >> this.fields.get(.).sortType
  详细解决方案

this.fields.get(.).sortType

热度:347   发布时间:2012-10-08 19:54:56.0
this.fields.get(...).sortType
我们在用gridPanel的时候,总会用到安某一列排序。如果不指定的话,

... ...
+ "{name: 'budgetName', 'name_cn': '预算单位名称','width':'120', type: 'String',editor:'true',hidden:'false',sum:'false'},"
+ "{name: 'price', 'name_cn': '申请金额','width':'120', type: 'float',editor:'true',hidden:'false',sum:'false'},"
... ...

可能会报下面的错误:‘this.fields.get(...).sortType’为空或不是对象,

这种情况下,给它指定一个排序就ok了

... ...
+ "{name: 'budgetName', 'name_cn': '预算单位名称','width':'120', type: 'String',editor:'true',hidden:'false',sum:'false'},"
+ "{name: 'price', 'name_cn': '申请金额','width':'120', type: 'float',editor:'true',hidden:'false',sum:'false',sort:'true',direction:'ASC'},"
... ...

  相关解决方案