I have a UIGrid with 3 columns. Based on the value of 2nd column, I need to create custom cell template for 3rd column. Example :
Row 1 : Expression1 : String : TextBox
Row 2 : Expression2 : Boolean : Dropdown with true & false.
I have tried adding custom cell template to the 3rd Column like snippet below:-
$scope.gridOptions.columnDefs = [
{ name: 'expression', displayName: 'Expression',enableCellEdit: false,enableSorting: false, width: '40%'},
{ name: 'type', displayName: 'Type',enableCellEdit: false,enableSorting: false, width: '30%' },
{ name: 'value', displayName: 'Value',enableCellEdit:true,enableSorting: false, width: '30%',editableCellTemplate: 'ui-grid/dropdownEditor',
editDropdownOptionsArray: [
{ id: 1, value: 'true' },
{ id: 2, value: 'false' }
}
];
But in this case the 3rd column cell will always have a dropdown with true and false. I need dynamic cell template based on the value of 2nd column cell, the 3rd column cell type has to be TextBox or Dropdown. Is there a way I can do this???
Thank you in advance.