easyUI----grid

1.设置标题行高

.datagrid-header-row td{background-color:rgb(15,185,234);color:#fff;height:35px ;font-size:14pt;font-family:"Microsoft Yahei",Verdana,Simsun,"Segoe UI Web Light","Segoe UI Light","Segoe UI Web Regular","Segoe UI","Segoe UI Symbol","Helvetica Neue",Arial }

2.设置内容行高
.datagrid-row { height: 32px; }

3.同步行和checkBox点击事件

function initGrid(taskTypeId){
$("#bt_buttion1").attr("class","tlbtn2 btndisabled");
$("#bt_buttion2").attr("class","tlbtn2 btndisabled");
$('#assctlgDiv').empty();
$('#assctlgDiv').datagrid({
url:"/../gridData.do?taskTypeId="+taskTypeId,
fitColumns : true,
fit : true,
checkbox : true,
rownumbers:true,
columns :[[
{
field : '',
title : '单选',
align : 'center',
checkbox : true
},
 {
field : 'bgtstage',
title : 'AAA',
halign:'center',
align : 'left',
width : '24%',
formatter:function(value , record , index){
if(value == 0){
return '<span style=color:red; >A</span>' ;
} else if( value == 1){
return '<span style=color:green; >B</span>' ;
} else if( value == 2){
return '<span style=color:blue; >C</span>' ;
}
}
}, {
field : 'confirmtime',
title : 'BBBB',
halign:'center',
align : 'left',
width : '24%',
formatter:function(value , record , index){
if(value == ""){
return '<span>AAA</span>' ;
}else{
return value;
}
}
}]],
onSelect: function () //选中一行
{
toolblock();
},
onUnselect:function ()
{
toolblock();
},
onSelectAll:function ()
{
toolblock();
},
onUnselectAll:function ()
{
$("#bt_buttion1").attr("class","tlbtn2 btndisabled");
$("#bt_buttion2").attr("class","tlbtn2 btndisabled");
}
});
};
function toolblock(){
var rows = $('#assctlgDiv').datagrid('getSelections');
var count = 0 ;
var count1 = 0 ;
$.each(rows, function (index, row) {
if(row.bgtstage=="0"){
count=count+1;
};
if(row.bgtstage=="1"){
count1=count1+1;
};
});
if(rows.length==count&&count>0){
$("#bt_buttion1").attr("class","tlbtn2");
}else if(rows.length==count1&&count1>0){
$("#bt_buttion2").attr("class","tlbtn2");
}else{
$("#bt_buttion1").attr("class","tlbtn2 btndisabled");
$("#bt_buttion2").attr("class","tlbtn2 btndisabled");
}
}

转载于:https://www.cnblogs.com/sx2zx/p/6340961.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值