【问题标题】:how to dynamically hiding a col on load complete using jqgrid如何使用jqgrid在加载完成时动态隐藏col
【发布时间】:2015-03-28 08:59:03
【问题描述】:

我想隐藏一列或根据我在加载事件中获得的数据选择不同的宽度,但它不起作用。这是我尝试过的代码

loadComplete : function(){
            $(this).jqGrid('setColProp', 'ID', {
                hidden: true
            });
        },

但 ID 列仍在显示...

【问题讨论】:

    标签: javascript jqgrid


    【解决方案1】:

    试试这个。 Sample fiddle

    loadComplete : function()
    {
       //Works with new api
       $(this).jqGrid('hideCol',["ID"]); 
       //following works with Older api
       //$(this).hideCol("ID");    
    }
    

    【讨论】:

    • 你能指点我这方面的文件吗?我也想改宽度,请问方法是什么?
    • @coure2011: jqGrid 4.6/4.7 没有任何方法可以让您动态地更改列宽。 用户只能使用列大小调整器的拖放(在两列的标题之间)。我写了你可以使用的setColWidth 方法(参见jQuery.jqGrid.setColWidth.js herethe answer)。我现在正在开发新的 free 版本的 jqGrid here。它包含调整列大小的方法和许多其他新功能。
    猜你喜欢
    • 2013-10-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-02-01
    • 1970-01-01
    相关资源
    最近更新 更多