Click here to Skip to main content
15,881,559 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
C#
$(document).ready(function () {
         $("#jqGrid").jqGrid({
             url: 'data.json',
             mtype: "GET",
             datatype: "json",
             colModel: [
                 { label: 'ID', name: 'ID', key: true, width: 75 },
                 { label: 'Task_Key', name: 'Task_Key', width: 150 },
                 { label: 'Process ', name: 'Process', width: 150 },
                 { label: 'Pending', name: 'Pending', width: 150 },
                 { label: 'Task_Cd', name: 'Task_Cd', width: 150 }
             ],
             loadonce: true,
             width: 780,
             height: 250,
             rowNum: 10,
             sortname: 'CustomerID',
             jsonReader: {
                 // instruct subgrid to get the data as name:value pair
                 subgrid: { repeatitems: false }
             },
             subGrid: true, // set the subGrid property to true to show expand buttons for each row
             subgridtype: 'json', // set the subgrid type to json
             subGridUrl: function (params) { // the url can be a function. In this case we build the urls depending on the id row
                 return params.id + '.json';
             },
             // description of the subgrid model
             subGridModel: [{
                 name: ["BO NO", "BO Date", "Customer Name", "Mobile NO", "Trial Date","Style","Qty","Process Rate"],
                 width: [60, 180, 150, 100, 70],
                 align: ["left", "left", "left", "left", "right"],
                 params: false
             }],
             pager: "#jqGridPager"
         });
     });
 </script>
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900