将按钮添加到jqGrid顶部工具栏 [英] Adding button to jqGrid top toolbar

查看:191
本文介绍了将按钮添加到jqGrid顶部工具栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

看起来jqGrid的默认工具栏总是在底部.诸如下一页/上一页"之类的按钮以及用于选择每页行数的下拉菜单将始终显示在网格底部.

Looks like the default toolbar for jqGrid is always at the bottom. Buttons like Next/Prev page and the dropdown to select the number of rows per page will always show at the bottom of the grid.

我找到了一种添加自定义顶部工具栏并将自定义按钮按入其中的方法.

I found a way to add a custom top toolbar and push custom buttons into it.

真正需要的是一种将默认功能(例如分页)添加到网格顶部而不是底部的方法.

What a really need is a way to add default functionality (like paging) to the top of the grid, instead the bottom.

推荐答案

我不明白为什么拥有顶级工具栏如此重要.您是否不使用分页或网格中有很多行,以至于没有滚动就无法看到底部的工具栏?还是还有其他原因?

I don't understand why it's so important to have top toolbar. Do you use no paging or have to many rows in the grid, that one can not see bottom toolbar without scrolling? Or there is another reason?

jqGrid有布尔型toppager参数(请参见设置网格)来创建其他首页.您可以显示工具栏,请参阅工具栏参数,但是我不确定您使用的术语与jqGrid相同.在 jqGrid演示上观看演示(展开"3.1版的新功能").也许您是说导航栏?

There is boolean toppager parameter of jqGrid (see setting options for the grid) to create additional top pager. You can display a toolbar see toolbar parameter, but I am not sure that you use the same terminology as jqGrid. Look at demo on jqGrid Demos (expand "New in version 3.1"). Probably you mean a navigation bar?

通常,jqGrid将显示HTML片段,并将所有片段与一些预定义的div元素分开.导航栏将放置在div内,其ID为"="pg_pager"和class ="ui-pager-control".您可以例如针对jQuery操作jqGrid,以将div移至其他位置.如果实现了这种移动,则每次在gridComplete事件句柄中(或在激发另一个完成事件之后)都应重做一次.

Generally jqGrid will display HTML fragment and divide all with some predefined div elements. Navigation bar will be placed inside the div with id="pg_pager" and class="ui-pager-control". You can manipulate jqGrid with respect of jQuery for example to move this div on the other place. If you implement such movement, you should redo this every time inside gridComplete event handle (or after one other completion event are fired).

已相对于jQuery('#element_to_be_moved').insertAfter('#existing_element')jQuery('#element_to_be_moved').insertBefore('#existing_element'),很容易将现有的HTML片段移动到另一个位置.在 jqGrid页脚单元格中,继承"来自主网格中单元格的CSS 我描述了一些重要的 div 的名称,这些名称是jqGrid的一部分.希望您在编码方面取得圆满成功.

EDITED: It is easy to move an existing HTML fragment to another place with respect of jQuery('#element_to_be_moved').insertAfter('#existing_element') or jQuery('#element_to_be_moved').insertBefore('#existing_element'). In jqGrid footer cells "inherits" CSS from cells in the main grid I described names of some important div's which are parts of jqGrid. I wish you much success in coding.

这篇关于将按钮添加到jqGrid顶部工具栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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