• <noscript id="ggggg"><dd id="ggggg"></dd></noscript>
    <small id="ggggg"></small> <sup id="ggggg"></sup>
    <noscript id="ggggg"><dd id="ggggg"></dd></noscript>
    <tfoot id="ggggg"></tfoot>
  • <nav id="ggggg"><cite id="ggggg"></cite></nav>
    <nav id="ggggg"></nav>
    成人黃色A片免费看三更小说,精品人妻av区波多野结衣,亚洲第一极品精品无码,欧美综合区自拍亚洲综合,久久99青青精品免费观看,中文字幕在线中字日韩 ,亚洲国产精品18久久久久久,黄色在线免费观看

    jqGrid 表格底部匯總、合計行footerrow處理

    2019-10-12    seo達人

    jqGrid提供了表格底部匯總、合計行功能,我們先看下user-guide關于jqGrid合計行都有哪些說明?然后再看個DEMO,看看jqGrid表格底部匯總、合計行到底如何實現。



    1、user-guide關于jqGrid合計行的說明

    1)表格配置:footerrow, boolean, 默認false

    If set to true this will place a footer table with one row below the gird records and above the pager. The number of columns equal those specified in colModel

    表格是否顯示底部合計行。



    2)表格配置:userDataOnFooter,boolean,默認false

    When set to true we directly place the user data array userData in the footer if the footerrow parameter is set to true. The rules are as follows: If the userData array contains a name which matches any name defined in colModel, then the value is placed in that column. If there are no such values nothing is placed. Note that if this option is used we use the current formatter options (if available) for that column. See footerData method.

    如果設為true,則userData可以用來填充匯總行。



    3)匯總行賦值:footerData([string action], [object data], [boolean format])

    This method gets or sets data on the grid footer row. When set data in the footer row, the data is formatted according to the formatter (if defined) in coModel. The method can be used if footerrow option is set to true.

    parameters

    string action - can be ‘get’ or ‘set’. The default is get. ‘get’ returns an object of type name:value, where the name is a name from colModel. This will return data from the footer. The other two options have no effect in this case. ‘set’ takes a data object and places the values in the footer The value is formatted according to the definition of the formatter in colModel - see next parameter. The object should be in name:value pair, where the name is the name from colModel

    object data - data to be set in the footer in name:value pair, where the name should correspond to the name of colModel in order to be set in the appropriate cell.

    boolean format - default is true. This instruct the method to use the formatter (if set in colModel) when new values are set. A value of false will disable the using of formatter



    2、一個DEMO,如何利用gridComplete事件進行表格數據匯總并賦值給合計行

    1)案例截圖



    2)html代碼



    <!DOCTYPE html>

    <html>

    <head>

    <meta charset="UTF-8" />

    <title>jggrid底部匯總行</title>



    <link rel="stylesheet" href="https://cdn.bootcss.com/twitter-bootstrap/3.3.7/css/bootstrap.min.css" />

    <link rel="stylesheet" href="https://cdn.bootcss.com/font-awesome/4.5.0/css/font-awesome.min.css" />

    <link rel="stylesheet" href="https://cdn.bootcss.com/jqueryui/1.11.0/jquery-ui.min.css" />

    <link rel="stylesheet" href="https://js.cybozu.cn/jqgrid/v5.3.1/css/ui.jqgrid.css" />

    <script src=";

    <script src="
    ;

    <script src="
    ;

    </head>

    <body>

    <div class="page-content container">

    <div class="page-body"> <!-- page-body -->

    <div class="panel panel-default" id="panel-orders">

    <table id="orders"></table>

    </div>

    </div>

    </div>

    <script type="text/javascript">

    var data = [];

    function getBills() {

    var rowCount = 10;

    for (var i = 0; i < rowCount; i ++) {

    data.push({

    sid: i,

    goods_no: i + 1,

    goods_name: '零件名稱' + rowCount + i,

    car_type_name: '車型' + rowCount + i,

    package_name: '包裝器具' + rowCount + i,

    unit_name: '件',

    snp: 0.89,

    bill_amount: rowCount + i,

    goods_count: rowCount + i,

    bill_no: 'BN0000000' + i,

    qrcode: '1000000000' + i,

    barcode: '1000000000' + i,

    })

    }

    $("#orders").jqGrid("clearGridData").jqGrid('setGridParam',{data: data || []}).trigger('reloadGrid');

    }

    $(function() {

    $("#orders").jqGrid({

    colModel: [

    {label: "零件號", name: "goods_no", width: 60},

    {label: "零件名稱", name: "goods_name", search:false, width: 180},

    {label: "車型", name: "car_type_name", width: 70},

    {label: "包裝器具", name: "package_name", width: 70},

    {label: "單位", name: "unit_name", width: 40},

    {label: "訂單號", name: "bill_no", width: 120},

    {label: "訂單數量", name: "goods_count", width: 80},

    ],

    datatype: 'local',

    rownumbers: true,

    height: 300,

    rowNum: 1000,

    footerrow: true,

    gridComplete: function() {

    var rows = $("#orders").jqGrid("getRowData"), total_count = 0;

            for(var i = 0, l = rows.length; i<l; i++) {

            total_count += (rows[i].goods_count - 0);

            }

            $("#orders").jqGrid("footerData", "set", {goods_name:"--合計--",goods_count:total_count});

            }

    });

    getBills();

    });

    </script>

    </body>

    </html>



    3)代碼說明:



    表格構建時,設置:footerrow: true

    gridComplete(jqGridGridComplete)事件處理,進行數據匯總并賦值給合計行

    gridComplete fires after all the data is loaded into the grid and all other processes are complete. Also the event fires independent from the datatype parameter and after sorting paging and etc. Does not fire if datatype is a defined as function.



    4)獲取匯總行數據

    var row = $("#orders").jqGrid(“footerData”, “get”);

    藍藍設計www.lzhte.cn )是一家專注而深入的界面設計公司,為期望卓越的國內外企業提供卓越的UI界面設計、BS界面設計  cs界面設計  ipad界面設計  包裝設計  圖標定制  用戶體驗 、交互設計、 網站建設 平面設計服務

    日歷

    鏈接

    個人資料

    藍藍設計的小編 http://www.lzhte.cn

    存檔

    主站蜘蛛池模板: 亚洲一区二区精品在线播放| 无码国产精品一区二区免费式直播| 男女做爱网站| 中文韩国午夜理伦三级好看| 97午夜影院| 国产精品女主播在线视频| 四虎库影成人在线播放| 国内精品久久久久影院嫩草| 国产精品一国产AV麻豆| 176精品免费| 国产私拍大尺度在线视频| 渝中区| 亚州AV成人无码久久精品| 最新97超级碰碰碰碰久久久久| 亚洲欧美日韩在线精品一区二区| 国产成人精品日本亚洲77上位| 九九久久99综合一区二区| 五月婷婷激情| 9.1原创大神| 亚洲一区二区无码视频| 东方四虎av在线观看| 日韩亚洲AV无码三区二区不卡 | 丰满的少妇人妻无码区| 欧美亚洲另类国产很色婷婷| 中文字幕欧美人妻精品一区| 亚洲欧洲无码AV一区二区三区| 亚洲国产精品日韩AV专区| 营山县| 欧美曰批视频免费播放免费 | 精品少妇爆乳无码av无码专区 | 国产精品99久久免费黑人人妻| 精品国产女同疯狂摩擦2| 亚洲精品久久久久久久久久久| 久久久久AV综合网成人| 亚洲AV无码精品色午夜果冻不卡| 国产高清在线男人的天堂| 国产深夜福利在线观看网站 | 国产一级一极性活片免费观看| 亚洲AV无码一区二区三区乱子伦| av中文字幕国产精品| 人妻少妇偷人精品视频一区二区|