wolfnbasti
Newbie
Posts: 16
|
|
« on: May 20, 2014, 03:00:52 PM » |
|
We are trying to edit data that is loaded in an edatagrid - this is how we are generating the grid - all data loads fine.
<table id="ClientData" title="Attributes" class="edatagrid" style="width:1200px;height:600px" toolbar="#toolbar" fitColumns="true" editable="true"></table> <div id="toolbar"> <a href="etc...">New</a> </div>
Javascript code:
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, }); } 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({ // frozenColumns: [frozenColumns], columns: [columns], data: rows, editable: true, fitColumns: true, singleSelect: true, nowrap: true, striped: true, onDblClickCell: function(index,field,value){ $(this).edatagrid('beginEdit', index); var ed = $(this).edatagrid('getEditor', {index:index,field:field}); //$(ed.target).focus();
window.alert('INDEX:' + index + ' FIELD:' + field ); } }); }); });
When I click on a cell the window.alert lists the index and field numbers. However var ed is null, and thus ed.target is null as well. The grid also never makes the grid cell editable, either. It appears that getEditor is never interpreting the index and field.
Any ideas?
Thank you.
|