I have set up a Plunker to demonstrate the issue here
When you click on the "Display rows with missing data" link, it correctly filters to show rows with missing data. However, if you then click on "show all data," the rest of the data does not reappear. How can this issue be resolved?
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";
}
};