zoukankan      html  css  js  c++  java
  • JqGrid添加数据行中添加按钮

    colNames: ['NewRequestId', 'Applicant', 'Applicant Department','Edit', 'Delete'], 
    colModel: [
    { name: 'NewRequestId', index: 'NewRequestId', hidden: true, sortable: false, align: "center", "1px" },
    { name: 'ApplicatUserName', index: 'ApplicatUserName', sortable: false, align: "center", "120px" },
    { name: 'ApplicatDepartment', index: 'ApplicatDepartment', sortable: false, align: "center", "140px" },
    { name: 'Edit', index: 'Edit', sortable: false, align: "center", "100px" },

    { name: 'Delete', index: 'Delete', sortable: false, align: "center", "100px" }

    ],

    在gridComplete事件中添加:

    gridComplete: function () {
    var ids = jQuery("#RequestList").jqGrid('getDataIDs');
    for (var i = 0; i < ids.length; i++) {
    var id = ids[i];
    var DeleteBtn = "<a href='#' style='color:#f60' onclick='OpenAllocationDialog()' >Abolish</a>";
    var editBtn = "<a href='#' style='color:#f60' onclick='OpenAllocationDialog()' >Edit</a>";
    jQuery("#RequestList").jqGrid('setRowData', ids[i], { Edit: editBtn, Delete: DeleteBtn });
    }


    },

  • 相关阅读:
    Express之托管静态文件
    Express与NodeJs创建服务器的两种方法
    NodeJs相关系列文章
    CentOS安装SVN
    图片上传之FileAPI与NodeJs
    Git的基本操作
    页面图片懒加载原理
    JavaScript原生的节点操作
    NodeJs之调试
    CentOS下使用NVM
  • 原文地址:https://www.cnblogs.com/hexinxiaoyao/p/2674678.html
Copyright © 2011-2022 走看看