angularjs - Angular UI Grid autocomplete with ui-grid-cellnav -
i have autocomplete in ui grid working fine when put ui-grid-cellnav directive keyboard , down arrow not working autocomplete.
<div class="grid nonproductivetimegrid" ui-grid="nonproductivetimegridoptions" ui-grid-resize-columns style="width: 100%;" ui-grid-edit ui-grid-cellnav ui-grid-auto-resize ui-grid-draggable-rows ui-grid-selection></div>
and controller code grid column
var _columnsdefs = function (islocked) { var cols = [{ field: 'responsibleparty', displayname: 'responsible party', enablecelledit: !islocked, editablecelltemplate: '<div><form name="inputform"><input type="input_type" typeahead-append-to-body="true" ng-class="\'colt\' + col.uid" ui-grid-editor ui-grid-edit data-ng-model="model_col_field" name="label" maxlength="100" required validate-required-cell data-typeahead="responsibleparty responsibleparty in grid.appscope.responsibleparties | filter:$viewvalue | limitto:8 " /></form></div>', width: '20%' }]; }
you don't have handler typeahead-on-select. change to
'data-typeahead-on-select="grid.appscope.typeaheadselected(row.entity, $item)" ' +
and add function
$scope.typeaheadselected = function(entity, item) { entity.name = item.name; // or whatever want //console.log(item); }
i had comment out line make work, lost auto-selection of entire text upon focus, means need double-click , select text (by mouse or ctrl + a) edit it. not sure why, maybe there's workaround that. have had same problem in-grid typeaheads.
//'ui-grid-edit ui-grid-editor ' +
anyway after changes double-click edit value, select state arrow keys , update entity.
Comments
Post a Comment