Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1. jquery-ui-1.10.4.custom.min.js
- 2. jquery.ui.core.js
- 3. jquery.ui.widget.js
- 4. jquery.ui.position.js
- 5. jquery.ui.menu.js
- 6. jquery.ui.autocomplete.js
- 1. grid.locale-en.js
- 2. jquery.jqGrid.min.js
- 3. grid.common.js
- 4. jqModal.js
- 5. jqDnR.js
- 6. grid.formedit.js
- 1. jquery-ui-1.10.4.custom.css
- 2. demos.css
- 3. jquery.ui.all.css
- colNames:['Id', 'First Name', 'Last Name'],
- colModel:[
- {name:'id',index:'id', width:55,editable:false,editoptions:readonly:true,size:10},hidden:true},
- {name:'firstname',index:'lastname', width:100,editable:true,edittype:'text',
- editoptions: {
- dataInit: function (elem) {
- myAutocomplete(elem, "${pageContext.servletContext.contextPath}/grid/autocomplete.action");
- }
- }},
- {name:'lastname',index:'firstname', width:100,editable:true, editrules:{required:true}, editoptions:{size:10}}
- ],
- var jq = jQuery.noConflict();
- jq(function() {
- jq("#grid").jqGrid({
- url:'${pageContext.servletContext.contextPath}/grid/load.action',
- datatype: 'json',
- mtype: 'GET',
- colNames:['Id', 'First Name', 'Last Name'],
- colModel:[
- {name:'id',index:'id', width:55,editable:false,editoptions:{readonly:true,size:10},hidden:true},
- {name:'firstname',index:'lastname', width:100,editable:true,edittype:'text',
- editoptions: {
- dataInit: function (elem) {
- myAutocomplete(elem, "${pageContext.servletContext.contextPath}/grid/autocomplete.action");
- }
- }},
- {name:'lastname',index:'firstname', width:100,editable:true, editrules:{required:true}, editoptions:{size:10}}
- ],
- postData: {
- },
- rowNum:20,
- rowList:[20,40,60],
- height: 200,
- autowidth: true,
- rownumbers: true,
- pager: '#pager',
- sortname: 'id',
- viewrecords: true,
- sortorder: "asc",
- caption:"Users",
- emptyrecords: "Empty records",
- loadonce: false,
- editurl:'${pageContext.servletContext.contextPath}/grid/edit.action',
- loadError : function(xhr,st,err) {
- console.log('display error : '+err);
- jq("#rsperror").html("Type: "+st+"; Response: "+ xhr.status + " "+xhr.statusText);
- },
- loadComplete: function() {
- },
- jsonReader : {
- root: "rows",
- page: "page",
- total: "total",
- records: "records",
- repeatitems: false,
- cell: "cell",
- id: "id"
- }
- });
- jq("#grid").jqGrid('navGrid','#pager',
- {edit:true,add:true,del:true,search:true},
- { },
- { },
- { },
- {
- sopt:['eq', 'ne', 'lt', 'gt', 'cn', 'bw', 'ew'],
- closeOnEscape: true,
- multipleSearch: true,
- closeAfterSearch: true }
- );
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement