将Jqgrid navButtonAdd图标添加到顶部(克隆的)导航器 [英] Adding Jqgrid navButtonAdd icon to the top(cloned) navigator

查看:109
本文介绍了将Jqgrid navButtonAdd图标添加到顶部(克隆的)导航器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用navButtonAdd在我的jqgrid中有一个列选择器,但是它将按钮添加到底部导航栏中.是否可以在克隆的导航栏顶部添加相同的图标.这是我的代码...

I am using navButtonAdd to have a column chooser in my jqgrid but it adds the button to the bottom navigation bar. Is it possible to add the same icon to the top of my cloned navigation bar. Here is my code...

jQuery("#grid").jqGrid({
         ......
         toppager: true,
         ....
    );  

jQuery("#grid").jqGrid('navGrid','#pager',
    {cloneToTop: true, edit:false, add:false, del:false, search:false},
        { }, { }, { }, { } );

jQuery("#grid").jqGrid('navButtonAdd', '#pager', {
    caption : "",
    buttonicon : "ui-icon-calculator",
    title : "Choose Columns",
    onClickButton : function() {
        jQuery("#grid").jqGrid('columnChooser');
    }
});

推荐答案

如果将创建toppager,它将具有根据网格ID和"_toppager"构造的ID,因此在您的情况下将为"grid_toppager".所以你应该使用

If the toppager will be created it will have the id constructed from the grid id and "_toppager", so it will be "grid_toppager" in your case. So you should use

jQuery("#grid").jqGrid('navButtonAdd', '#grid_toppager', {...});

请参见此处这里以获取更多详细信息和演示.

See here and here for more details and for demos.

这篇关于将Jqgrid navButtonAdd图标添加到顶部(克隆的)导航器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆