2014-11-21 93 views
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控制器只是圍繞網格,而不是圍繞選擇...)

回答

1

你介意發佈一個plunker或你的代碼小提琴嗎?很難看到它,我正在處理類似的事情。乾杯!

編輯:看看StackOverflow'ers,一個OP誰回答自己的問題與工作的解決方案。一個真正罕見和雄偉的野獸見證。從他的評論:http://embed.plnkr.co/d37YrfRjE7YZPgwCncBE/preview

+0

我複製粘貼一個plunker爲你:http://embed.plnkr.co/d37YrfRjE7YZPgwCncBE/preview – sdhd 2014-11-26 09:18:25

+0

你回答了你自己的問題,併發布瞭解決方案!你真的是模範公民,OP – Max 2014-11-26 17:53:27