亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

使用jqgrid在標題底部添加工具欄

使用jqgrid在標題底部添加工具欄

蝴蝶刀刀 2020-02-02 14:08:40
我想在標題底部添加一個帶有不同按鈕的工具欄。有沒有可能?用過的 toolbar: [true,"top"] or toolbar: [true,"bottom"] 其顯示相同的工具欄...底部的工具欄包含添加,編輯,刪除按鈕..我想在頂部工具欄中進行更改,僅包含添加按鈕..&底部工具欄包含編輯,刪除,刷新等。謝謝,
查看完整描述

2 回答

?
qq_花開花謝_0

TA貢獻1835條經驗 獲得超7個贊

可能您誤解toolbar了jqGrid的參數。也許您想使用具有附加定義jqGrid選項的Navigator。此選項在jqGrid的頂部克隆尋呼機div。之后,您可以輕松地從頂部或底部“工具欄”中刪除一些元素:cloneToTop: truetoppager: true


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();

由于我們使用<table>id =“ list”的元素,因此將使用與上面的代碼不同的id名稱的“ list”部分。


查看完整回答
反對 回復 2020-02-02
?
Cats萌萌

TA貢獻1805條經驗 獲得超9個贊

從演示站點:


的HTML


Java Scrpt代碼


    jQuery("#myGrid").jqGrid({

  url:'server.php?q=1',

  datatype: "xml",

  colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],

  colModel:[

    {name:'id',index:'id', width:55},

    {name:'invdate',index:'invdate', width:90},

    {name:'name',index:'name', width:100},

    {name:'amount',index:'amount', width:80, align:"right"},

    {name:'tax',index:'tax', width:80, align:"right"},      

    {name:'total',index:'total', width:80,align:"right"},       

    {name:'note',index:'note', width:150, sortable:false}       

  ],

  rowNum:10,

  rowList:[10,20,30],

  pager: '#pgmyGrid',

  sortname: 'id',

  viewrecords: true,

  sortorder: "desc",

  caption:"Toolbar Example",

  editurl:"someurl.php",

  toolbar: [true,"top"] //THIS IS IMPORTANT!

  });

  jQuery("#myGrid").jqGrid('navGrid','#pgmyGrid',{edit:false,add:false,del:false});


  $("#t_myGrid").append("<input type='button' value='Click Me' style='height:20px;font-size:-3'/>");


查看完整回答
反對 回復 2020-02-02
  • 2 回答
  • 0 關注
  • 1058 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號