zoukankan      html  css  js  c++  java
  • jqgrid操作列循环显示三个按钮

    首先ajax取数据

    $.ajax(
    {
    type: "get",
    url: "../../MECManage/TJYY/collect",
    cache: false,
    async: false,
    data: { coljson: JSON.stringify(coljson) },
    dataType: 'json',
    error: function () {
    alert("数据出错!");
    },
    success: function (data) {

     DrawListTwo(data,gridTables)

    //后面的参数是放表格table的ID

    }

    function DrawListTwo(data, id) {
    var colModelData = [{ name: "clus_code", label: "编号", hidden: true },

    { name: "clus_name", index: "clus_name", label: "套餐", 130 }, { name: "price", label: "价格", '55px' }, {
    name: "process",
    index: "process",
    label: "操作",
    125,
    sortable: true,
    align: 'center'
    }
    ];
    var $gridTables = $("#" + id);
    $gridTables.jqGrid({
    datatype: "local",
    styleUI: 'Bootstrap',
    data: data.lnc,
    height: 550,
    auto true,
    colModel: colModelData,
    sortorder: 'desc',
    rownumbers: true,
    shrinkToFit: false,
    //height: 340,
    viewrecords: true,
    gridComplete: function () {
    var ids = jQuery("#gridTables").jqGrid('getDataIDs');
    for (var i = 0; i < ids.length; i++) {
    var cl = ids[i];
    update = "<input type='button' value='编辑' onclick='updateCollect(" + cl + ")'/>&nbsp;";
    copy = "<input type='button' value='复制' onclick='deleteStu("
    + cl + ")'/>&nbsp;";
    delet = "<input type='button' value='删除' onclick='viewStu("
    + cl + ")'/>";
    jQuery("#gridTables").jqGrid('setRowData',
    ids[i], {
    process: update + copy + delet
    });
    }
    }
    });
    }

  • 相关阅读:
    有趣的项目链接分享
    Nano Pi安装Opencv-python
    Opencv
    安装库的步骤
    EC20 AT指令
    最详细树莓派/NanoPi网线和电脑直接连接方法
    在Altium Designer中如何将一组器件合并为一个?
    Altium Designer如何快速查找PCB板上元件
    pip升级之后,不能使用
    利用opencv-python(cv2)查看设备连接摄像头的数量
  • 原文地址:https://www.cnblogs.com/xuelishuyue/p/6892882.html
Copyright © 2011-2022 走看看