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

查看:108
本文介绍了无法将传呼器(导航栏)定位在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');

如果使用define <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天全站免登陆