hi, please help me!
i have a igHierarchicalGrid here!
var reportTemplate = data.ReportTemplate; $("#grdReportTemplate").igHierarchicalGrid({ //initialDataBindDepth: 1, dataSource: reportTemplate, //dataSourceType: "json", //responseDataKey: "d", autoGenerateColumns: false, primaryKey: "RecordID", width: "100%", height: "500px", renderCheckboxes: true, columns: [ { headerText: "RecordID", key: "RecordID", width: "50px", dataType: "number", hidden: true }, { headerText: "ReportID", key: "ReportID", width: "130px", dataType: "number", hidden: true }, { headerText: "ParentReportID", key: "ParentReportID", width: "50px", dataType: "number", hidden: true }, { headerText: "Select", key: "IsChecked", width: "80px", dataType: "bool" }, { headerText: "ReportDsc", key: "ReportDsc", width: "130px", dataType: "string" }, { headerText: "ReportFileName", key: "ReportFileName", width: "50px", dataType: "string", hidden: true }, { headerText: "Object Type", key: "ObjectType", width: "50px", dataType: "number", hidden: true } ], autoGenerateLayouts: false, defaultChildrenDataProperty: "oReport", columnLayouts: [ { name: "oReport", childrenDataProperty: "oReport", //autoGenerateColumns: false, responseDataKey: "oReport", primaryKey: "RecordID", ForeignKey: "ParentReportID", renderCheckboxes: true, columns: [ { headerText: "RecordID", key: "RecordID", width: "50px", dataType: "number", hidden: true }, { headerText: "ReportID", key: "ReportID", width: "130px", dataType: "number", hidden: true }, { headerText: "ParentReportID", key: "ParentReportID", width: "50px", dataType: "number", hidden: true }, { headerText: "Select", key: "IsChecked", width: "80px", dataType: "bool" }, { headerText: "ReportDsc", key: "ReportDsc", width: "400px", dataType: "string" }, { headerText: "ReportFileName", key: "ReportFileName", width: "50px", dataType: "string", hidden: true }, { headerText: "Object Type", key: "ObjectType", width: "50px", dataType: "number", hidden: true } ], features: [ { name: "Updating", enableAddRow: false, editMode: "row", enableDeleteRow: false, showDoneCancelButtons: false, columnSettings: [ { columnKey: "IsChecked", editorOptions: { type: "bool", disabled: false } }, { columnKey: "ReportDsc", editorOptions: { type: "string", disabled: true } } ] }], } ], features: [ { name: "Updating", enableAddRow: false, editMode: "row", enableDeleteRow: false, showDoneCancelButtons: false, columnSettings: [ { columnKey: "IsChecked", editorOptions: { type: "bool", disabled: false } }, { columnKey: "ReportDsc", editorOptions: { type: "string", disabled: true } } ] }], });
i loop all record of grid to get ReportID if column IsChecked= true but i can not get child record of grid
updates1 = $.extend({}, grid1.data('igGrid').pendingTransactions()); var lsTemplateChecked = ""; $.each(updates1, function (index, transaction) { switch (transaction.type) { case "row": if (transaction.row.IsChecked == true && transaction.row.ObjectType == 1) { if (lsTemplateChecked == "") { lsTemplateChecked = transaction.row.ReportID; } else { lsTemplateChecked = lsTemplateChecked + "," + transaction.row.ReportID; } } break; } });
How can i get column of igHierarchicalGrid above?
Thanks you very much!!
Hello Cuong,
You may get the desired column of the child grid using some of the following API methods: columnByKey or columnByText
As you need to specify the correct selector for the child grid in order these methods to return the child grid columns, not the parent one. In order to get the child grid container id, you may inspect the child grid table on the client using browser's developer tools.
If you need further assistance, please let me know.
Regards,
Tsanna
your explain to short (perhap, i don't register product) and now i registed
one thing, i'm from Việm Nam so my english not too good. so please explain enought clearly to understand
return my question
in my code i can loop into all pedingtransaction record of parent
i want to do something like with child record
please help me!
thanks u very much!
thanks you very much!
it very helpful
it done
one again thanks you very much!!
Hello Coung,
Can I help you with anything else?
Hi Cuong,
To get the pending transactions of either parent or child grid, you may use the following API method: http://help.infragistics.com/jQuery/2014.2/ui.iggrid_hg#methods:pendingTransactions
In order to access the child grid you may use the following selector: $("#grdReportTemplate_[some_client_ID]_[child_data_responseKey]_child"), where
- [some_client_ID] is generated on the client
- [child_data_responseKey] is the responseKey of the dataSource used for the child grid
As an example, the child grid in this online sample: http://www.igniteui.com/hierarchical-grid/overview could be accessed through this selector: $("#hierarchicalGrid_1946846921_Products_child")
And as I've already explained to you in my previous response, you may get the child grid id by inspecting the table element on the client using the browser's developer tools. I'm attaching also a screenshot demonstrating that.
After you have the child grid id, then you can call also 'pendingTransactions' method on it and loop through them.
If you have any further difficulties, please let me know.
Regards,Tsanna