I have grid with combo editor for one column.. while grid is bind this way :$('#uoaAuditGrid').igGrid('option', 'dataSourceType', 'json').igGrid('option', 'dataSource', uoaExtendedData).igGrid('dataBind');I also need dynamically provide datasource for the combo which is editor for the column AuditName.
How do I obtain reference so I can do something like this : $(".selector").igCombo("option", "dataSource", ds);
I tried : var editor = $('#uoaAuditGrid')..igGridUpdating("editorForKey", "AuditName"); it did not return anything...
Also where would be related topic in the documentation.
Thanks
$(function () { $('#uoaAuditGrid').igGrid({ columns: [ .................................................. { key: 'AuditName', headerText: 'Audit Name', width: '25%' }, { key: 'AuditId', dataType: 'number', hidden: true }, { key: 'uoa_ba_Id', dataType: 'string', hidden: true } ],
autoGenerateColumns: false, features: [
{ name: 'Updating', enableAddRow: false, editMode: 'cell', columnSettings: [ { columnKey: 'Name', readOnly: true }, { columnKey: 'Description', readOnly: true } , { columnKey: 'uoaBenefitYear', readOnly: true } , { columnKey: 'AuditName', editorType: 'combo', editorOptions: { autoComplete: true, // dataSource: pageController.getAvailAudits(), allowCustomValue: false, textKey: 'AuditName', valueKey: 'AuditName', showDropDownButton: false, enableClearButton: false
} } ........................................................................ });
No, Thanks.. all clear..
Hello mcseidel,
Do you need any further assistance regarding this matter?
Regards,Tsanna
I assume that this is the only way to access the editor offline without being it in edit mode. The other way is through some igGrid Updating event, as I suggested in my previous post. If I can provide you with further assistance, please let me know.
Hi Tsanna,
columnByKey actually misspelled in the Ignite UI API help doc and online : var col = $(".selector").igGrid("columnsByKey", "ProductName");
var
col = $(
".selector"
).igGrid(
"columnsByKey"
,
"ProductName"
);
columnByKey does not reveal editor but while doing this
var columnSettings = $('#uoaAuditGrid').igGridUpdating("option", "columnSettings"); $.each(columnSettings, function () { if (this.columnKey === "AuditName") { this.editorOptions.dataSource = audits; }
} )
I am getting column setting with editor options when I reach the AuditName column than just assign data source... seems like this is working..
Is there a way to obtain reference to the editor without scanning the whole column setting
The error is due to misspelled name of the method. The right one is columnByKey. Regarding your first question if you want to access the combo editor and change its dataSource at runtime, you may handle some igGrid Updating event for example editCellStarting or editCellStarted and use the following syntax:
var newComboDs = [{ "ID": 5, "Name": "test" }];
...
editCellStarted: function (evt, ui) { ui.editor.igCombo("option", "dataSource", newComboDs); }
If you have further questions, please let me know.