Click here to Skip to main content
15,881,849 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i using jqgrid to display two columns namely propertyname,value. at run time i need to edit value column and save it i am using below code
$(document).ready(function () {
var mydata = [
{ propertyname: "one", "value": " " },
{ propertyname: "two", "value": " " },
{ propertyname: "three", "value": " " }
];

$("#JQGrid").jqGrid({ //set your grid id
data: mydata, //insert data from the data object we created above
datatype: 'local',
width: 500, //specify width; optional
colNames: ['PropertyName', 'Value'], //define column names
colModel: [
{ name: 'propertyname', index: 'propertyname', width: 50, editable: false },
{ name: 'value', index: 'value', width: 50, editable: true, sortable: true, edittype:'text'}
], //define column models
//set your pager div id
sortname: 'id', //the column according to which data is to be sorted; optional
viewrecords: true, //if true, displays the total number of records, etc. as: "View X to Y out of Z” optional
sortorder: "asc", //sort order; optional
caption: "jqGrid Example" //title of grid


});
});
Posted
Updated 24-Jul-14 2:57am
v2

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