從不同的控制器打開模態彈出窗口。在關閉模式彈出窗口時,我會做一些事情,並且我想將數據傳輸到另一個填充UI網格的控制器,並綁定到$scope.searchResultsGridOptions
。角度刷新UI網格
在一個模式的結束,我做的::
$("#iConfirmationModal").on('hidden.bs.modal', function() {
$state.go('transaction.search.results', {});
//I close all the modals
$uibModalStack.dismissAll();
//I get the stored search criteria
var searchResultsParam = TransactionDataServices.getSavedSearchParams();
//Using them I hit the web service again and get the data to reload the UI Grid
TransactionServices.getTransactionAdvSearchResults(searchResultsParam).then(function (result) {
//I got the result
console.log(result);
/Now I want to reload the grid with this data , but the grid scope object which binds to this , is in separate controller
searchResultsGridOptions.data = result;
});
});
在DEFCtrl.js
我
getSearchResultsGridLayout: function (gridOptions, uiGridConstants, datas) {
gridOptions.multiSelect = false;
// gridOptions.data.length = 0;
// gridOptions.data = '';
gridOptions.data = datas;
console.log("Grid Data ");
console.log(datas);
console.log(gridOptions.data);
angular.element(document.getElementsByClassName('grid')[0]).css('height', '0px');
// console.log(datas.length);
return gridOptions;
}
但如何將
我ABCCtrl.js
文件
所以我只在模式關閉時才更改數據?
剩下的時間它不應該刷新網格?
或者,
有什麼辦法當在模式關閉,而不是簡單地回到使用$state.for()
,看到以前未刷新數據的狀態,我可以看到更新的資料?