wolfnbasti
Newbie
![*](https://jeasyui.com/forum/Themes/default/images/star.gif)
Posts: 16
|
![](https://jeasyui.com/forum/Themes/default/images/post/xx.gif) |
« on: May 22, 2014, 08:31:03 PM » |
|
I use the following to create a editable datagrid: var attributeDefs; var resources; var resourceDef; var attributeValues; var attributeIds;
$(function() { $.ajax({ url: '../rest/...../attributes', type: "GET", }).done(function(data) { attributeDefs = data.attributeDefs; resourceDef = data.resourceDef; resources = data.resources; attributeValues = data.attributes.values; attributeIds = data.attributes.ids; var frozenColumns = []; frozenColumns.push({ field: '0', title: 'Name', align: 'left', width: 100, resizable: true, editable: true, fixed: false, }); var columns = []; columns.push({ field: '0', title: 'Name', align: 'left', width: 100, resizable: true, editable: true, fixed: false }); for (var i = 0; i < attributeDefs.length; i++) { columns.push({ field: (i + 1).toString(), title: attributeDefs.name, align: 'left', width: 100, resizable: true, fixed: false, editable: true, editor: 'text', }); } var rows = []; for (var i = 0; i < resources.length; i++) { var attributeObject = {'0' : resources.name}; for (var j = 0; j < attributeDefs.length; j++) { attributeObject[(j + 1).toString()] = attributeValues[j]; } rows.push(attributeObject); } $('#ClientData').edatagrid({ columns: [columns], data: rows, editable: true, fitColumns: true, singleSelect: true, nowrap: true, striped: true, onDblClickCell: function(row, field, value) {
} }); }); });
<table id="ClientData" title="Attributes" class="edatagrid" style="width:1200px;height:600px" toolbar="#toolbar" fitColumns="true" editable="true" ></table>
I need to capture the value of the changed cell after the onDblClickCell line as soon as the user clicks anywhere else in the grid or out of it. Any ideas how this might be done?
Thanks.
|