easyui 动态添加列
2015-11-13 20:21
405 查看
var options={}; |
$( function (){ |
var myNj =9; |
//初始化 |
$( "#disgrid" ).datagrid({ |
type: 'POST' , |
nowrap: false , |
striped: true , |
fit: true , |
width:1024, |
height:500, |
url: '' , |
pageSize:30, |
remoteSort: false , |
pagination: true , |
rownumbers: true , |
singleSelect: true , |
queryParams:{ |
nj:myNj, |
unitType:1 |
} |
}); |
fetchData(myNj); |
}); |
function fetchData(nj) { |
var s "" ; |
s "[[" ; |
s "{field:'unitname',title:'单元',width:160},{field:'practicetime',title:'测试 ; |
//lu |
if (nj==9) { |
s "{field:'aipanel_text_exam',title:'短文朗读',width:80}, ; |
s ",{field:'tatal_score',title:'总分',width:60,formatter:function(value,rec) ; |
} else if (nj==7||nj==8){ |
//.... |
} |
s "]]" ; |
options={}; |
options.url '/app/search.do' ; |
options.queryParams |
nj:nj, |
unitType:1 |
}; |
options.columns |
//lu 增加一列 |
options.columns[0].push( |
{ |
field: 'desc' ,title: '查看详情' ,width:60, |
formatter: function (value,rec){ |
return "<a href=\"javascript:showDescInfo(\'" +rec.serial+ "\',\'" +rec.scene_score+ " \',\'" +rec.total_score+ "\');\">详情</a>" ; |
} |
} |
); |
$( '#disgrid' ).datagrid(options); |
$( '#disgrid' ).datagrid( 'reload' ); |
} |
相关文章推荐
- LeetCode_Range Sum Query - Immutable
- LeetCode_Range Sum Query 2D - Immutable
- easyui动态添加文本域
- UINavigationItem UINavigationBar分析
- [leetcode-304]Range Sum Query 2D - Immutable
- tableViewCell的不同高度创建
- UI第四天:事件处理
- 分别使用Jmeter/Loadrunner/SoapUI做Web Service接口测试的简单操作
- 问题:-[UIViewController _loadViewFromNibNamed:bundle:] loaded the "BlueView" nib but the view outlet was not set.
- 111 AddressBookUI
- 根据输入的起止日期判断天数,strtotime,数据的去重和array_keys,array_values函数
- 用Fragment制作的Tab页面产生的UI重叠问题
- 【leetcode】【62】Unique Paths
- 安卓UI开发基础-View
- IE浏览器中 $.ajax返回uindefined 其他浏览器正常
- shuxue
- zuihao
- Testing Round #12 C Subsequences
- 导航条UINavigationBar和工具栏tabBar的灰色高亮线去掉
- [JS]EASYUI组件的程序基本结构