开发者社区> 问答> 正文

按jqGrid的wiki写的代码,Navigator不显示出来

按jqGrid的wiki操作,现在能实现把grid显示出来,并绑定后台的json数据。但是在参考 http://www.trirand.com/jqgridwiki/doku.php?id=wiki:navigator的时候,直接复制wiki的代码不能把navigator的按钮。我是调用 jQuery("#grid_id").navGrid('#gridpager',{parameters},prmEdit, prmAdd, prmDel, prmSearch, prmView) 这个方法操作的。请问有谁遇过这个问题吗?navGird方法调用后给定恰当的参数,增删改查按钮会自动显示出来的还是需要自己另外配置的呢?

---------------问题补充---------------
@肥昊:<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>主页</title> <link rel="stylesheet" type="text/css" media="screen" href="<%=request.getContextPath()%>/css/ui-lightness/jquery-ui.css" /> <link rel="stylesheet" type="text/css" media="screen" href="<%=request.getContextPath()%>/css/ui.jqgrid.css" /> <script src="<%=request.getContextPath()%>/js/jquery.js" type="text/javascript"></script> <script src="<%=request.getContextPath()%>/js/i18n/grid.locale-<%=request.getLocale().getCountry().toLowerCase()%>.js" type="text/javascript"></script> <script src="<%=request.getContextPath()%>/js/jquery.jqGrid.js" type="text/javascript"></script> <script type="text/javascript"> $(function(){ var lastSel = null; $("#equipment_grid").jqGrid({ url:'<%=request.getContextPath()%>/equipment/list/json', datatype : 'json', mtype : 'GET', colNames : [ 'id', 'name', 'ip', 'port', 'username', 'password', 'updateTime' ], colModel : [ { name : 'id', index : 'id', jsonmap : 'id', width : 55, editable : true }, { name : 'name', index : 'name', jsonmap : 'name', width : 55, editable : true }, { name : 'ip', index : 'ip', jsonmap : 'ip', width : 90, editable : true }, { name : 'port', index : 'port', jsonmap : 'port', width : 80, align : 'right', editable : true }, { name : 'username', index : 'username', jsonmap : 'username', width : 80, align : 'right', editable : true }, { name : 'password', index : 'password', jsonmap : 'password', width : 80, align : 'right', editable : true }, { name : 'updateTime', index : 'updateTime', jsonmap : 'updateTime', datefmt : 'yyyy-MM-dd HH:mm:ss', formatter : 'date', formatoptions : { newformat : 'Y-m-d H:i:s' }, width : 150, sortable : false, editable : true } ], pager : '#equipment_pager', rowNum : 10, rowList : [ 10, 20, 30 ], sortname : 'id', sortorder : 'desc', jsonReader : { root : "equipments", page : "page", total : "total", records : "records", repeatitems : false }, viewrecords : true, caption : '设备列表' }); }); jQuery("#equipment_grid").jqGrid('navGrid','#equipment_pager',{edit:false,add:false,del:false}); </script> <style> html,body { margin: 0; padding: 0; font-size: 75%; } </style> </head> <body> <table id="equipment_grid"> <tr> <td /> </tr> </table> <div id="equipment_pager"></div> </body> </html>

展开
收起
a123456678 2016-07-05 16:17:51 2313 0
1 条回答
写回答
取消 提交回答
  • 全改成true

    jQuery("#equipment_grid").jqGrid('navGrid','#equipment_pager',{edit:true,add:true,del:true});
    2019-07-17 19:51:35
    赞同 展开评论 打赏
问答地址:
相关产品:
问答排行榜
最热
最新

相关课程

更多

相关电子书

更多
《零基础HTML入门教程》 立即下载
低代码开发师(初级)实战教程 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载