zoukankan      html  css  js  c++  java
  • 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%";
      }
     }
    });​

  • 相关阅读:
    第一周作业
    模拟赛3 题解
    模拟赛2 题解
    [HNOI2008]GT考试 题解
    NOI Online 提高组 题解
    模拟赛1 题解
    知识点拾遗
    [NOIp2012]疫情控制 题解
    [CEOI2002]Bugs Integrated, Inc. 题解
    [NOIp2017]宝藏 题解
  • 原文地址:https://www.cnblogs.com/suruozhong/p/5974717.html
Copyright © 2011-2022 走看看