【问题标题】:Use cellvalue of other column in jqgrid formatter在 jqgrid 格式化程序中使用其他列的单元格值
【发布时间】:2016-03-18 08:03:29
【问题描述】:

我可以在 colModel 的格式化键中使用其他列的单元格值吗? 所以基本上,我想改变cellvalue --> cellvalue of some other column

    colModel.push({
        'formatter': function(cellvalue, options, rowObject) {
            return '<a href="http://someLink/' + cellvalue + '">' + cellvalue + '</a>';
        }
    });

【问题讨论】:

    标签: jquery jqgrid free-jqgrid


    【解决方案1】:

    让我们有两列name: "mycol1"name: "mycol2",并且您想在第1列中添加自定义formatter,它使用了锚点URL中输入数据的属性mycol1和属性@ 987654325@作为锚文本。代码可能如下:

    colModel.push({
        name: 'mycol1',
        formatter: function(cellvalue, options) {
            return '<a href="http://someLink/' + cellvalue + '">' +
                    options.rowData.mycol2 + '</a>';
       }
    });
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-06-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-12-04
      • 1970-01-01
      • 2015-01-03
      • 1970-01-01
      相关资源
      最近更新 更多