1
我想在UI的選擇結果裝訂成UI格...HOWTO綁定一個角度UI的選擇結果UI網/ NG網
$scope.gridOptions = {
enableSorting: true,
showFooter: true,
columnDefs: [
{ field: 'name', name: 'Name' },
],
data: 'multipleDemo.selected',
onRegisterApi: function(gridApi) {
$scope.gridApi = gridApi;
}
};
$scope.selectItem = function (item, model) {
$scope.gridApi.core.notifyDataChange($scope.gridApi.grid, uiGridConstants.dataChange.EDIT);
};
我的玉模板是這樣的:
ui-select(theme='bootstrap', multiple='', ng-model='multipleDemo.selected', ng-disabled='disabled', close-on-select='false', on-select='selectItem()')
ui-select-match(placeholder='select something...') {{$item.name}}
ui-select-choices(repeat='f in data | filter: $select.search')
div(ng-bind-html='f.name | highlight: $select.search')
#grid.grid(ui-grid="gridOptions")
編輯
我解決了這個問題。 (我的ng控制器只是圍繞網格,而不是圍繞選擇...)
我複製粘貼一個plunker爲你:http://embed.plnkr.co/d37YrfRjE7YZPgwCncBE/preview – sdhd 2014-11-26 09:18:25
你回答了你自己的問題,併發布瞭解決方案!你真的是模範公民,OP – Max 2014-11-26 17:53:27