I have created a plunker to show issue here
If you click on the "Display rows with missing data" link then all is well and it filters to show row with misssing data. However, if you then click on "show all data" it will not show the rest of the data again? How to resolve this?
Code:
vm.applyMissingValuesFilter = function (linktext) {
if (linktext === "Display rows with missing data") {
vm.savedResourceGridResources = vm.resourceGridResources;
var results = [];
var temp = vm.resourceGridResources.Resources;
for (var i = 0; i < temp.length; i++) {
for (var j = 0; j < temp[i].Resources.length; j++) {
if (!temp[i].Resources[j].Value) {
if (results.indexOf(temp[i]) === -1) {
results.push(temp[i]);
}
}
}
}
vm.resourceGridResources.Resources = results;
vm.missingValuesButtonText = "Show all data";
}
else if (linktext === "Show all data") {
// should reset the resource values here to redisplay original data?
vm.resourceGridResources = vm.savedResourceGridResources;
vm.missingValuesButtonText = "Display rows with missing data";
}
};