<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <title>grid.html</title> <meta http-equiv="keywords" content="keyword1,keyword2,keyword3" /> <meta http-equiv="description" content="this is my page" /> <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> <link rel="stylesheet" type="text/css" media="screen" href="css/themes/redmond/jquery-ui-1.8.2.custom.css" /> <link rel="stylesheet" type="text/css" media="screen" href="css/themes/ui.jqgrid.css" /> <link rel="stylesheet" type="text/css" media="screen" href="css/themes/ui.multiselect.css" /> <link rel="stylesheet" type="text/css" media="screen" href="css/themes/jquery.searchFilter.css" /> <style> html,body { - -margin: 0; /* Remove body margin/padding */ padding: 0; overflow: hidden; /* Remove scroll bars on browser window */ font-size: 75%; } </style> <script src="js/jquery-1.4.2.min.js" type="text/javascript"></script> <script src="js/jquery-ui-1.8.2.custom.min.js" type="text/javascript"></script> <script src="js/src/ui.multiselect.js" type="text/javascript"></script> <script src="js/src/grid.loader.js" type="text/javascript"></script> <script type="text/javascript"> $.jgrid.no_legacy_api = true; $.jgrid.useJSON = true; </script> <script type="text/javascript"> $(function(){ $("#grid_id").jqGrid({ url:'/demo2/servlet/JqGridJsonServlet', mtype: 'GET', datatype: 'json', jsonReader : { id: "invId",//the unique id of the row.如果不设置则默认为行号. repeatitems: false //element tells jqGrid that the information for the data in the row is repeatable - i.e. the elements have the same tag cell described in cell element. Setting this option to false instructs jqGrid to search elements in the json data by name. This is the name from colModel or the name described with the jsonmap option in colModel. //A very useful feature here is that there is no need to include all the data that is represented in colModel. Since we make a search by name, the order does not need to match the order in colModel. //设置为false,则可以在json串中根据列/值为传数据,并且列/值在json串中的位置可以随意,也可以不传。 }, height: "auto", loadui: "disable", colNames:['Inv No','Date', 'ClientId', 'Amount','Tax','Total','Notes'], colModel :[ {name:'invId', index:'invId', width:70}, //name:Set the unique name in the grid for the column. This property is required. As well as other words used as property/event names, the reserved words (which cannot be used for names) include subgrid, cb and rn. //index:Set the index name when sorting. Passed as sidx parameter.index是后台排序时使用。 {name:'invDate', index:'invDate', width:120, editable:true}, {name:'client_Id', index:'client_Id', width:120, editable:true}, {name:'amount', index:'amount', width:90, align:'right', editable:true}, {name:'tax', index:'tax', width:90, align:'right', editable:true}, {name:'total', index:'total', width:90, align:'right', editable:true}, {name:'note', index:'note', width:180, sortable:false, editable:true} ], pager: '#pager', rowNum:10, rowList:[10,20,30], sortname: 'invid', sortorder: 'asc', viewrecords: true, caption: 'My first grid' }); //jQuery("#grid_id").jqGrid('navGrid','#pager',{parameters},prmEdit, prmAdd, prmDel, prmSearch, prmView) jQuery("#grid_id").jqGrid('navGrid','#pager',{add:true,edit:true,view:true,del:true,search:true,refresh:true}, {url:'/demo2/servlet/JqGridJsonServlet',closeAfterEdit:true, closeOnEscape:true, left:240}, // settings for edit {url:'/demo2/servlet/JqGridJsonServlet',closeAfterAdd:true, closeOnEscape:true, left:240}, // settings for add {url:'/demo2/servlet/JqGridJsonServlet',closeAfterEdit:true, closeOnEscape:true, top:90, left:240, resize:false, drag:false}, // settings for del {multipleSearch:true, closeOnEscape:true}, // enable the advanced searching {closeOnEscape:true, left:240} // allow the view dialog to be closed when user press ESC key ); }); </script> </head> <body> <table id="grid_id"></table> <div id="pager"></div> </body> </html>
详细解决方案
jqGrid:5、 Form Editing
热度:669 发布时间:2012-11-16 14:12:15.0
相关解决方案
- 求jquery.form.js+jquery.validate.min.js 用ajax提交表单的代码范例
- 关于<form action >的一个有关问题
- 新手求解,使用struts报错Cannot retrieve definition for form bean studsForm on action /stu,该怎么解决
- jquery form 有关问题
- form 表单交付 <form action="<c:url value='desktop'/>"
- 项目好好的,忽然就Unknown tag (s:form).不知道为什么
- ENCTYPE="multipart/form-data"文件下传有关问题
- 生手求解,使用struts报错Cannot retrieve definition for form bean studsForm on action /stu
- CAPTCHA 模块中 ajax form 导致CAPTCHA session reuse attack detected异常,解决方法
- enctype="multipart/form-data"的页面中,获取普通表单中文值,
- 在jsp页面下导入.xls文件,报错:Posted content type isn't multipart/form-data
- jsp form 表单 提交 带特殊符号 求高手帮忙解答上多谢!
- form.getForm.submit对象不支持此属性或步骤
- jsp中<form>标记有关问题?头疼了很多天
- action无法获取<s:form>的输入解决方法
- form action 和 javascript 的提交問題解决方法
- s:form 的anction 标签[]
- 关于enctype="multipart/form-data"及过滤器的怪异有关问题~
- import form.addBookForm 有晓得这个包的出处的嘛?SOS~
- Windows Form 中怎么将 treeview 的节点与页面内容关联
- 怎样把Html文本转换为System.Windows.Form.HtmlDocment对象!解决方法
- Form.FormClosing事件不触发(winform)解决思路
- 将html form 内容写到后盾
- .net MVC下运用FckEditor检测到有潜在危险的 Request.Form
- 从客户端(FCKeditor1="哇啦哇")中检测到有潜在危险的 Request.Form 值
- freetextbox 检测到有潜在风险的 Request.Form 值
- 从客户端(Content="<p>测试</p>")中检测到有潜在风险的 Request.Form 值
- context.Request.Form[""]获取不到值,该怎么解决
- 为什么asp.net4.0中禁用请求验证还提示“有潜在危险的 Request.Form 值”解决思路
- jqgrid,该如何处理