dataGrid查询表格

waf("#Gird").dataGrid("reloadGrid")   //重新发请求去装载数据
 
waf("#Grid").wafGrid("reloadGrid")  //不会重新发请求,会重刷新
 
waf("#Grid").wafGrid("delRow",id)   //删除一行
 
waf("#grid").wafGrid("getAllRowData")  // 获取所有行数据 

waf("#dataGridPerPay").wafGrid('getColValue',"amount",false,'sum'); //统计某一列的值

//判断是否有选中行提示
_self.showWarning(waf.dynamicList.info.selectRow);
 
隐藏按钮
waf("#id").wafLinkButton("option","hidden",true)

显示按钮
waf("#id").wafLinkButton("option","hidden",false)
 
隐藏表格某一列
waf("#表格id").wafGrid("hideColumn","name",true)
显示
waf("#表格id").wafGrid("showColumn","name",true)
 
隐藏整个查询表格
waf("#gbox_表格id").hide()
显示
waf("#gbox_表格id").show()
 
获取选中多行的值
var rows = waf("#queryGrid").dataGrid("getSelectedRows")
 
获取选中行id
var id = rows[1]
var column = rows[1]["colnumName"]
 
获取选中行字段值(要根据id再去获取)
var data = waf('#Grid').wafGrid('getRowRealData',id)
var String = data.字段名
 遍历id拼成字符串
var rowids;
var rowidArray = [];
for(var i=0; i<rows.length; i++){
    rowidArray.push(rows[i]);
}
rowids = rowidArray.join("','");
 
获取选中一行的id
waf("#queryGrid").dataGrid("getSelectedRow")

//合并列头
waf("#queryGrid").wafGrid('setGroupHeaders', {useColSpanStyle:true,groupHeaders:
    [{startColumnName: 'curMonthLimit', numberOfColumns: 2, titleText: '<center>额度</center>'},
    {startColumnName: 'curMonthAmount', numberOfColumns: 2, titleText: '<center>已用额度</center>'}
    ]});


//设置过滤条件
waf("#dataGrid").wafGrid("otion","filterItems","绑定属性=值");

//列格式化
waf.defineCustomeClass("cellformatter.ratioFomatter", cellformatter.defaultFormatter, {
format: function(cellval, rwd){
//alert(rwd['signPayListEntry.appAmount']);
if (rwd['signPayListEntry.appAmount']&&rwd['signPayListEntry.actRevAmount']) {
    return (rwd['signPayListEntry.actRevAmount']/rwd['signPayListEntry.appAmount']*100).toFixed(2)+"%";
}
else {
    return "0%";
  }
 }
});​

 

posted @ 2016-10-18 20:05  suruozhong  阅读(952)  评论(0编辑  收藏  举报