i'm having an issue getting the row edit dialog to pop up Ihave it configured like this, assume i'm doing something wrong. using version 2012.2 I select row then tried F2, doubleclick and enter nothing seems to happen, I looked with firebug an don't see any errors. Note i'm using cakephp framework view to render page below is javascript, the grid populates it just seems row edit functionality not working. any assistants would be appreciated TIA
var ds = null;var jsonp = null;$(document).ready(function () { $.ig.loader({ scriptPath: 'ig/js/', cssPath: 'ig/css/', resources: 'igHierarchicalGrid.*', theme: 'metro' });
var render = function (success, error) { if (success) { var ds = jsonp
} else { alert(error); } };
$.ig.loader(function () { var jsonp = new $.ig.DataSource({ dataSource: "/childcare/api/users.json", datatype: "jsonp", callback: "render", responseDataKey: "User" });
$("#grid1").igHierarchicalGrid({ dataSource: jsonp, dataSourceType: "json", responseDataKey: "User", autoGenerateColumns: false, autoGenerateLayouts: false, width: "100%", initialDataBindDepth: -1, primaryKey: "id", features: [ { name: "Selection", mode: "row", activation: true }, { name: 'Paging', type: 'local', pageSize: 10 }, { name: "Updating", editMode: 'rowedittemplate', enableAddRow: true, enableDeleteRow: true, rowEditDialogWidth: 400, rowEditDialogHeight: 400, rowEditDialogFieldWidth: 150, enableDataDirtyException: true, inherit: true, startEditTriggers: "dblclick,F2,enter", }
], columns: [ { key: "id", headerText: "ID", dataType: "string", width: "130px" }, { key: "username", headerText: "User Name", dataType: "string", width: "130px" }, { key: "password", headerText: "Password", dataType: "string", width: "130px" }, { key: "lastname", headerText: "last name", dataType: "string", width: "130px" }, { key: "phone", headerText: "Phone", dataType: "string", width: "130px" }, { key: "email", headerText: "Email", dataType: "string", width: "130px" }, { key: "role", headerText: "Role", dataType: "string", width: "130px" }, { key: "created", headerText: "Created", dataType: "date", width: "130px" }, { key: "modified", headerText: "Modified", dataType: "date", width: "100px" } ]
}); });});
I changed the java script reference to use CDN and the dialog now pops up, it has fields but they are not populated?
scriptPath: "http://cdn-na.infragistics.com/jquery/20122/latest/js/", cssPath: "http://cdn-na.infragistics.com/jquery/20122/latest/css/", resources: 'igHierarchicalGrid.*', theme: 'metro'
Hi,
The problem with the empty fields is that the record cannot be found by primary key. The type of your primary key column is declared as "string", but it is "number", so change it to "number" in order to make it work.
$(document).ready(function () {}); is not needed when you use Infragistics loader. Loader calls the $.ig.loader(function() {}); when the required JavaScript files are downloaded and parsed and the DOM is loaded.
I see that you're instantiating igHierarchicalGrid, but there is only one layout defined in the grid. Is it on purpose? Maybe you didn't post all the code, so I'm just checking. If you don't use the igHierarchicalGrid functionality then it is better to use igGrid instead.
Hope this helps,
Martin Pavlov
Infragistics, Inc.