无法在 jqGrid 上方定位寻呼机(导航栏) [英] Unable to position pager (navigation bar) above jqGrid

查看:17
本文介绍了无法在 jqGrid 上方定位寻呼机(导航栏)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据 jqGrid 文档,我应该能够通过移动寻呼机 div 将寻呼机放置在 jqGrid 上方或下方.不幸的是,寻呼机总是呈现在网格下方.

According the the jqGrid documentation, I should be able to place the pager above or below the jqGrid by moving the pager div. Unfortunately, the pager always renders below the grid.

<div id="pager"></div>
<table id="list">
    <tr>
        <td />
    </tr>
</table>

jqGrid 配置(与寻呼机相关)如下所示:

The jqGrid configuration (related to the pager) looks like:

pager: '#pager',
pginput: false,
pgbuttons: false,

有什么建议吗?

推荐答案

你应该使用 toppager:true jqGrid 选项.您不需要定义 <div id="pager"></div> 并使用 pager: '#pager' 参数.jqGrid 顶部的寻呼机 id 将是list_toppager"(表元素的 id 附加_toppager").

You should use toppager:true jqGrid option instead. You don't need define <div id="pager"></div> and use pager: '#pager' parameter. The id of the pager from the top of jqGrid will be "list_toppager" (id of the table element appended with "_toppager").

如果你想添加导航器可以使用

If you want to add navigator you can use

$("#list").jqGrid('navGrid','#list_toppager');

如果您使用定义 <div id="pager"></div> 并使用 pager: '#pager' 参数,您将拥有 两个寻呼机:一个在网格顶部带有 id="list_toppager",另一个在底部带有 id="pager".如果您想同时使用顶部和底部寻呼机,您可以使用

If you use define <div id="pager"></div> and use pager: '#pager' parameter you will have two pager: one with id="list_toppager" on top of the grid and anothe with id="pager" on the bottom. If you want use both top and bottom pager you can use

$("#list").jqGrid('navGrid','#pager',{cloneToTop:true});

然后移动或删除(参见 另一个答案了解更多详细信息和演示示例).您还可以使用 jQuery.insertAfter 函数非常轻松地将按钮从一个工具栏移动到另一个工具栏(请参阅 这里).

and then move or remove (see another answer for more details and the demo example). You can also very easy move buttons from one toolbar to the other using jQuery.insertAfter function (see here).

这篇关于无法在 jqGrid 上方定位寻呼机(导航栏)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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