I am using knockout.js to create jqgrid and populate the data using observableArray. (using Knockout-jqGridBinding plugin) Array for jqgrid data:
var initialData = [{
id: ko.observable(1),
name: ko.observable("Well-Travelled Kitten"),
sales: ko.observable(352),
price: ko.observable(75.95)
}];
function viewModel() {
var self = this;
self.items = ko.observableArray(result);
}
ko.applyBindings(new viewModel());
HTML
<table>
<tbody data-bind="foreach: items">
<tr>
<td><input data-bind="value: id"/></td>
<td><input data-bind="value: name"/></td>
<td><input data-bind="value: sales"/></td>
<td><input data-bind="value: price"/></td>
</tr>
</tbody>
</table>
<table id="items" data-bind="grid: { data: items }" >
<thead>
<tr>
<th data-field="actions" style="width:27px;" data-sortable="false"></th>
<th data-field="name" width="150px" data-editable="true">Item Name</th>
<th data-field="sales" data-editable="true">Sales Count</th>
<th data-field="price" data-editable="true">Price</th>
</tr>
</thead>
</table>
Now it populates the data in jqgrid and if I change data outside it reflects in grid as well but when I am changing the data in jqgrid using "cellEdit" it's not reflecting.