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");

    }

    这些都是博主多年积累的,有些可能是别人的,但博主已经不记得来自哪里了,就不特殊标出了,望见谅!!!!
  • 相关阅读:
    C++test 关于resource参数和include/exclude参数说明
    开发程序 ip 127.0.0.0 0.0.0.0原理与区别
    安装rails旧版本出错bin_path': can't find gem railties (["3.0.5"]) with executable rails (Gem::GemNotFoundException)
    rails excel的创建
    ruby nil? empty? blank? 的区别
    rails 调试工具pry 换掉debugger 和 rails c
    rails respond_to 的原理与使用
    rails transaction 的用法
    ssh的传送文件命令
    出现了pid的错误A server is already running. 和如何改变webrick的端口值
  • 原文地址:https://www.cnblogs.com/objectxhy/p/6742934.html
Copyright © 2011-2022 走看看