使用 jqgrid 在标题底部添加工具栏 [英] Add toolbar in the bottom of the header using jqgrid

查看:22
本文介绍了使用 jqgrid 在标题底部添加工具栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在标题底部再添加一个带有不同按钮的工具栏.有没有可能?

i want to add one more tool bar with different buttons in the bottom of the header. is there any possibilities?

二手

 toolbar: [true,"top"] or toolbar: [true,"bottom"] 

它显示相同的工具栏...在底部工具栏中包含添加、编辑、删除按钮..我想在顶部工具栏中进行更改,仅包含添加按钮.. &底部工具栏包含编辑、删除、刷新等,

its showing same toolbars... in the bottom toolbar contains Add, edit, delete buttons.. i want to make change in top toolbar contains ADD button only.. & bottom toolbar contains Edit, Delete, refresh, etc.,

谢谢,

推荐答案

可能你误解了jqGrid的toolbar参数.也许您想使用 Navigator 具有 cloneToTop: true 如果您另外定义 toppager: true jqGrid 选项,则该选项有效.此选项克隆 jqGrid 顶部的寻呼机 div.在此之后可以轻松地从顶部或底部工具栏"中删除一些元素:

Probably you misunderstood toolbar parameter of the jqGrid. Perhaps you want use Navigator having cloneToTop: true which works if you define additionally toppager: true jqGrid option. This option clone the pager div on the top of the jqGrid. After this one can easy remove some elements from the top or bottom "toolbar":

jQuery("#list").jqGrid({
    // some parameters
    toppager: true,
    // some other paremeters
}).jqGrid('navGrid','#pager',{cloneToTop:true});

var topPagerDiv = $("#list_toppager")[0];
$("#edit_list_top", topPagerDiv).remove();
$("#del_list_top", topPagerDiv).remove();
$("#search_list_top", topPagerDiv).remove();
$("#refresh_list_top", topPagerDiv).remove();
$("#list_toppager_center", topPagerDiv).remove();
$(".ui-paging-info", topPagerDiv).remove();

var bottomPagerDiv = $("div#pager")[0];
$("#add_list", bottomPagerDiv).remove();

将使用上面代码中不同 id 名称的列表"部分,因为我们使用 id="list" 的 <table> 元素.

The part "list" of different id names from the code above will be used because we use <table> element with id="list".

这篇关于使用 jqgrid 在标题底部添加工具栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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