i have this grid options:
$scope.ngOptions = {
data: 'data',
columnDefs: [
{field: 'Status', displayName: "Status", cellTemplate: selectTableTemplate, enableCellEdit: true},
{cellTemplate: '<button ng-click="update(col, row)">' + Save + '</button>', enableCellEdit: false }]
};
var selectTableTemplate = "<select ng-model='Status' ng-change='changeToFirst(Status, row)'>" +
'<option value="1" class="ng-binding" ng-selected="COL_FIELD == 1">' + 1 + "</option>" +
'<option value="2" class="ng-binding" ng-selected="COL_FIELD == 2">' + 2 + "</option>"</select>";
EDIT:
how in ng-change
function changeToFirst
i get the clicked element and select the first option selected?
i do this like this:
row.elm.children().find('select').find('[value=1]').prop('selected', true);
but i sure that not the right way