Having trouble getting a button to call the getFilteredRows() function in my MVC app's view and controller. I've tried various combinations, but the button just won't trigger the function. Can anyone help me figure out why?
@using ProjectExplorer.Web.Helpers
@model ProjectExplorer.Web.ViewModels.IProjectHeaderViewModel
@{
var projects = Model.ProjectHeaders;
}
<div>
<div class="projectlist" ng-controller="MatchingProjectsController as vm"
ng-init='vm.init(@Html.JsonFor(projects))'>
<h3>Matching Projects</h3>
@Html.ActionLink("Export to Excel", "ExcelExport")
<button ng-click="getFilteredRows()">Get Filtered Rows</button>
<div id="projectsGrid" ui-grid="vm.projectsTableData" ui-grid-resize-columns ui-grid-selection class="grid gridlist"></div>
</div>
</div>
(function () {
"use strict";
window.app.controller("MatchingProjectsController", MatchingProjectsController);
function MatchingProjectsController(uiGridConstants) {
var vm = this;
vm.init = init;
function init(projects) {
vm.projects = projects;
vm.projectsTableData = _.map(projects, _.partialRight(_.pick, "projectId", "projectServiceNumber", "location", "name", "country", "completionYear", "totalAreaSquareFeet", "totalAreaSquareMeters", "constructionCost", "constructionStatusName", "hasImagery"));
vm.projectsTableData = {
enableColumnSorting: true,
enableFiltering: true,
enableVerticalScrollbar: false,
columnDefs: [
// Columns definition goes here...
],
enableColumnMenus: false,
exporterMenuPdf: false,
data: vm.projectsTableData,
onRegisterApi: function (gridApi) {
vm.gridApi = gridApi;
}
};
}
vm.filteredRows = [];
vm.getFilteredRows = function () {
var _renderedRows = vm.gridApi.grid.renderContainers.body.renderedRows;
vm.filteredRows = vm.gridApi.core.getVisibleRows(vm.gridApi.grid);
};
}
})();
//# sourceMappingURL=MatchingProjectsController.js.map