I currently have a set of json data that I wish to filter through, however it does not work when i attempt to filter through it & shows an error: ‘ TypeError: ‘undefined’ is not a function ‘
Here’s a snippet:
load: function(data){
for (var i = 0; i < data.length; i++) {
var titlePane = new TitlePane({
title: data[i].Name ,
open: false,
content: '<div>' + data[i].Summary + '</div>'
});
titlePane.placeAt(dom.byId('licenseContainer'));
titlePane.filter({ Archived:true });
}
},
As you can see I only want to have the json data that are archived to be displayed.
Here’s a snippet of my json data:
[ {"Name":"james", "Archived":true, "Summary": "sfksfsd"}, {"Name":"kay", "Archived":false, "Summary": "sfksfsd"}, {"Name":"greg", "Archived":true, "Summary": "sfksfsd"} ]
Any ideas why this is not working?
EDIT Update function to do what I assume the OP wants the filter method to do for him.
You call a function
dom.byIdwhen I think you really meant to saydojo.byIdYour function should in fact look like this: