jquery jqGrid colModel 某一列添加超链接

来源:互联网 发布:linux 777 什么权限 编辑:程序博客网 时间:2024/05/21 22:26

Hi 今天收到一个开发请求,说是在与原来的展示列表中的一列添加超链接:

代码如下所示:

$(document).ready(function(){        //jqGrid        $("#providerList").jqGrid({            url:'<%=request.getContextPath() %>/Admin/getProvidersList',            datatype: "json",                           colNames:['Id','Edit','Provider Name'],            colModel:[                {name:'providerId',search:false,index:'providerId',hidden:true},                {name:'providerId',search:false,index:'providerId', width:30,sortable: false, formatter: editLink},                {name:'providerName',index:'providerName', width:200},                rowNum:20,                rowList:[10,20,30,40,50],                rownumbers: true,                  pager: '#pagerDiv',                sortname: 'providerName',                  viewrecords: true,                  sortorder: "desc",          });         $('#gridContainer div:not(.ui-jqgrid-titlebar)').width("100%");        $('.ui-jqgrid-bdiv').css('height', window.innerHeight * .65);        $('#load_providerList').width("130");           $("#providerList").jqGrid('navGrid','#pagerDiv',{edit:false,add:false,del:false},{},{},{}, {closeAfterSearch:true});        $(".inline").colorbox({inline:true, width:"20%"});    });    function editLink(cellValue, options, rowdata, action)    {        return "<a href='<%=request.getContextPath()%>/Admin/editProvider/" + rowdata.providerId + "' class='ui-icon ui-icon-pencil' ></a>";    }

阅读全文
0 0
原创粉丝点击