从不同的控制器打开模态弹出窗口。在关闭模式弹出窗口时,我会做一些事情,并且我想将数据传输到另一个填充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()
,看到以前未刷新数据的状态,我可以看到更新的资料?