我只是想使用此代碼:UI-Grid gridOptions - > selectOptions as Variable not possible?
field: 'field1',
filter: {
term: 1,
condition: uiGridConstants.filter.STARTS_WITH,
placeholder: 'starts with...',
ariaLabel: 'Starts with filter for field1',
flags: { caseSensitive: false },
type: uiGridConstants.filter.SELECT,
//selectOptions: [{ value: '1', label: 'male' }, { value: '2', label: 'female' }],
selectOptions: [$scope.DropdownEntries],
disableCancelFilterButton: false
}
的gridOptions selectOption陣列回來形式DropdownEntries是空的,因爲如果gridOptions沒有設置在DropdownEntries()的變量是無法訪問的,它們來自互聯網服務和加載它們需要更長的時間,因爲gridOptions被設置。
在確定所有變量都可以訪問後,有沒有可能「重新加載」gridOptions?或者有另一種方法來解決這個問題
- 我是AngularJS和Ui-Grid的新人,感謝您的幫助!