Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .on("click", function(){
- var myId = $(this).attr("id");
- $("#studentGrid").jqGrid.setSelection(myId, true);
- });
- $("#studentGrid").jqGrid({
- url: '<c:url value="/students/studentjsondata"/>',
- datatype: 'json',
- height: 'auto',
- colNames:['id','First Name', 'Last Name', 'Other Name' ,'Date Of Birth', 'Gender'],
- colModel:[
- //Bla Bla Bla
- ],
- rowNum:10,
- autowidth: true,
- pager: '#pager',
- sortname: 'id',
- viewrecords: true,
- sortorder: "desc",
- caption:"Students",
- emptyrecords: "Empty Records",
- subGrid: true,
- /* <![CDATA[ */
- onSelectRow: function(id){
- if((lastsel != 0)&&(id!==lastsel)){
- $("#studentGrid").jqGrid('collapseSubGridRow', lastsel);
- }
- lastsel=id;
- }/* ]]> */ ,
- subGridOptions: {
- "plusicon" : "ui-icon-triangle-1-e",
- "minusicon" : "ui-icon-triangle-1-s",
- "openicon" : "ui-icon-arrowreturn-1-e",
- "reloadOnExpand" : true,
- "selectOnExpand" : true
- },
- subGridRowExpanded: function(subgrid_id, row_id) {
- //Bla Bla Bla
- }
- });
- {'page':'1', 'records':'1', 'total':'1', 'rows':[{'id':'7385', 'cell': ['Max', 'Payne', '', 'September 16, 2012', 'Male']}]}
- .on("click", function(){
- var myNewData = eval('(' + $(this).attr("griddata") + ')');
- $("#studentGrid").jqGrid('setGridParam', { datatype: 'local', data: myNewData}).trigger('reloadGrid');
- });
- .on("click", function(){
- $("#studentGrid").jqGrid('setGridParam', { jsonReader: { repeatitems: false }, datatype: 'jsonstring', datastr: $(this).attr("griddata")}).trigger('reloadGrid');
- });
- $("#studentGrid").jqGrid('setGridParam', { jsonReader : {
- root: "rows",
- page: "page",
- total: "total",
- records: "records",
- repeatitems: true,
- cell: "cell",
- id: "id",
- userdata: "userdata",
- subgrid: {root:"rows",
- repeatitems: true,
- cell:"cell"
- }
- } , datatype: 'json', datastr: null});
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement