zoukankan      html  css  js  c++  java
  • ParamQueryGrid绑定数据

    表格工具:https://paramquery.com/pro

    <!---------------------------------------PQGrid引用----------------------------------------------->
    <link href="../../scripts/pqgrid/pqgrid.min.css" rel="stylesheet" />
    <link href="../../scripts/pqgrid/pqgrid.ui.min.css" rel="stylesheet" />
    <link href="../../scripts/pqgrid/jquery-ui.min.css" rel="stylesheet" />
    <link href="../../scripts/pqgrid/themes/bootstrap/pqgrid.css" rel="stylesheet" />
    <script src="../../scripts/pqgrid/jquery-ui.min.js" type="text/javascript"></script>
    <script src="../../scripts/pqgrid/pqgrid.min.js" type="text/javascript"></script>
    <!--------------------------------------PQGrid引用------------------------------------------------>

    function DataPQGrid(){

    //var data = "[{'id':1,'code':'B001','color':'红色','pic':'','unit':'米','inventory':1,'status':0,'brand':'波司登','manufacturer':'波士顿','contact':'理','contactTel':'133','exp1':0,'exp2':12.00,'exp3':'','exp4':'','exp5':'','factoryid':1}]";
    // var data=eval("(" + json + ")");
    var obj = {
    scrollModel: { autoFit: true },
    numberCell: {show: false},
    title: "面料明细",
    selectionModel: { type: null },
    pasteModel: { on: false },
    sortModel: {on : false},
    height: 'flex',
    "80%",
    // pageModel: { type: "local", rPP: 10 },
    colModel:
    [
    { title: "主键", 100, dataType: "integer", dataIndx: "id" ,hidden:true},
    { title: "面料编号", 100, dataType: "integer", dataIndx: "code" ,editor: false},
    { title: "颜色", 100, dataType: "string", dataIndx: "color",editor: false },
    { title: "品牌", 100, dataType: "float", align: "center", dataIndx: "brand",editor: false },
    { title: "库存", 100, dataType: "float", align: "center", dataIndx: "inventory",editor: false },
    { title: "消耗", 100, dataType: "float", align: "center", dataIndx: "fabricxh" },
    { title: "单位", 100, dataType: "float", align: "center", dataIndx: "unit",editor: false }
    ],
    dataModel: {
    // data:data
    location: "remote",
    type: 'post',
    dataType: "text",
    url: "HandlerAjax.ashx?action=get_fabric_json&factoryid="+$("#hidFactory").val()+"&stylecode="+$("#txtStyleCode").val(),
    getData: function (dataJSON) {
    var data = eval("(" + dataJSON + ")");
    return {data: data };
    }
    },
    selectChange: function (evt, ui) {
    console.log('selectChange', ui);
    var address = ui.selection.address();
    $("#select_change_div").html(JSON.stringify(address));
    }
    };
    $("#gridf_json").pqGrid(obj);
    $("#gridf_json").pqGrid("refreshDataAndView");

    }

    这些都是博主多年积累的,有些可能是别人的,但博主已经不记得来自哪里了,就不特殊标出了,望见谅!!!!
  • 相关阅读:
    如何在某些情况下禁止提交Select下拉框中的默认值或者第一个值(默认选中的就是第一个值啦……)
    渗透测试
    如何制作chrome浏览器插件之一
    linux中的vi命令
    链栈
    二进制转16进制JAVA代码
    抽象数据类型的表示与实现
    变量的引用类型和非引用类型的区别
    说明exit()函数作用的程序
    计算1-1/x+1/x*x
  • 原文地址:https://www.cnblogs.com/objectxhy/p/6742934.html
Copyright © 2011-2022 走看看