- 注册时间
- 2012-9-28
- 最后登录
- 2014-1-3
- 阅读权限
- 10
- 积分
- 608
- 精华
- 0
- 帖子
- 155
|
解决了
var columns = pGrid.getColumns();
for (var i=0;i< columns.length;i++){
var column = columns
for (var obj in column){
//当是OBJECT时,都不是必要的参数可以舍去
if ((typeof(column[obj])=="object" && obj!="editor") || obj.substr(0,1)=='_'){
delete column[obj];
}
}
grid.addRow({"gridId":pGrid.getId(),"field":column.field,"synax":mini.encode(column),"defaultHeader"!$.isFunction(column.header)&&column.type!="checkcolumn")?column.header:"[控件]","header"!$.isFunction(column.header)&&column.type!="checkcolumn")?column.header:"[控件]","display":true,"export":true,"print":true,"orderList":i+1})
关键代码在这if ((typeof(column[obj])=="object" && obj!="editor") || obj.substr(0,1)=='_'){
delete column[obj];
} |
|