【问题标题】:jqgrid subgrid need to change the plus/minus icons with text messagejqgrid subgrid 需要用短信更改加号/减号图标
【发布时间】:2014-11-06 10:44:16
【问题描述】:

在 JQGrid 中,当我们默认启用子网格时,它会显示“+/-”图标来展开/折叠子网格。但在我们的例子中,我们需要使用查看成员/隐藏成员之类的文本来更新它.jqgrid中提供了一个选项,即subgridoptions,我们只能提供图标类而不是文本消息。有没有办法做到这一点。

【问题讨论】:

    标签: jquery jqgrid subgrid


    【解决方案1】:

    您可以使用这些文本“查看成员”和“隐藏成员”创建两个图像。并使用下面的代码在 jqgrid 标题中显示和隐藏图像。

     $("#" + "img_" + subgrid_table_id).bind("click", function (e) {
    
                                      var status = $(this).parent().parent().parent().find('.ExpandODiv').is(":hidden");
                                      $(this).parent().parent().parent().find('.ExpandODiv').slideToggle();
    
                                      if (status == true) {
                                          $(this)[0].src = '../Content/images/icon_collapse_jqgrid.png';
                                          BindContractRateGrid($(this).parent().parent().parent().find('.batchid').html(), $(this).parent().parent().parent().find('.gridname').html() + 1);
                                      }
                                      else {
                                          $(this)[0].src = '../Content/images/icon_expand_jqgrid.png';
    
    
                                      }
    
                                  });
    

    【讨论】:

    • 感谢您的回答。我们可以不创建图像吗
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-02-22
    • 2023-03-19
    • 2020-10-31
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多