1.linkbutton的可见性。
$("#upAllBtn a").linkbutton({disabled : false});
$("#file_toolbar a").linkbutton({disabled : true});
2.datagrid选中的那一行
var row = file_dataGrid.datagrid('getSelected');
file_dataGrid = $("#file_dataGrid").datagrid({
url:root()+"/list",
fit:true,
rownumbers:true,
autoRowHeight:false,
fitColumns:true,
striped:true,
singleSelect:true,
pagination:true,
pageSize:100,
pageList:[5,10,20,30,50,100,200,300,400,500,1000],
columns:[[
{
field:"id",
title:"编号",
width:"5%",
hidden:true
},{
field:"created",
title:"产生时间",
width:"15%"
}]],
onSelect:function(index,row){
},
onClickRow : function(index, row) {
},
onDblClickRow:function(index,row){
}
,onLoadSuccess:function(data) {
}
});
4.格式化函数
formatter:function(value,row,index){
var v =value;
if (value){
var result=$.ajax({type:'post',url:root()+"/type.json",async:false});
$.each($.parseJSON(result.responseText),function(id,data){
if(data.code==value){
v = data.text;
}
});
return v;
}
}
5.重新刷新表格及定位到第一页
$.post(root()+"/lists/create",{},function(result) {
if (result.success) {
$('#file_dataGrid').datagrid("reload");
var pager = $('#file_dataGrid').datagrid('getPager');
pager.pagination('select',1);
}
},'JSON');
6.弹出一个框,框的内容是另一个jsp
$.modalDialog({
id:"searchDialog",
title:'附加记录',
iconCls:"icon-window",
width:800,
height:535,
modal:true,
content:'<iframe src="'+root()+'/append?id='+row.id+'" style="width:100%;height:100%;margin:0;padding:0;border:0;"></iframe>'
});