【问题标题】:How to add icon for particular icon in column header in jqgrid?如何在jqgrid的列标题中为特定图标添加图标?
【发布时间】:2018-08-27 12:27:08
【问题描述】:

如何在 jqgrid 的列标题中为特定图标添加图标?我试图将它添加到 colmodel 中它可以工作,但是在单击该图标后它也会对网格进行排序。因此,无需触摸排序,如何在列标题中为特定列添加图标

colNames:['Id','Location','Address <span class="infoIconForGaps"</span>&nbsp'],

【问题讨论】:

  • colModel中的图标是怎么定义的?可以发个例子吗?
  • 编辑了问题。它给出了图标,但是当我单击该图标时,它也会进行排序。我不想在单击该图标时进行排序需要给出弹出消息。否则,如果我不单击该图标,它应该进行排序

标签: jquery jqgrid


【解决方案1】:

这可以通过使用参数 disableClick 的以下技巧来完成

<script type="text/javascript"> 
    function stopsort() {
        $("#jqGrid").jqGrid('setGridParam',{"disableClick":true});
    }

    $(document).ready(function () {
        $("#jqGrid").jqGrid({
            colNames:['Id','Location','Address <span class="infoIconForGaps"  onclick="stopsort()"></span>&nbsp'],
        ....

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-09-25
    • 2022-07-15
    • 2012-11-30
    • 1970-01-01
    • 1970-01-01
    • 2021-01-11
    • 1970-01-01
    • 2014-10-04
    相关资源
    最近更新 更多