-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfilter.js
More file actions
24 lines (23 loc) · 723 Bytes
/
Copy pathfilter.js
File metadata and controls
24 lines (23 loc) · 723 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/*Creating an object that shall hold all info about an NGO*/
var ngo_template={Name:"-", Donation:"",YoEst:"", Where:"-", filter_display: "0"};
var ngos=[];
ngos.push(ngo_template);
ngos[0].Name="NGO1";
ngos[0].Donation="Money";
ngos[0].YoEst="1999";
ngos[0].Where="Hamirpur";
ngos[0].filter_display="0";
ngos.push(ngo_template);
ngos[1].Name="NGO2";
ngos[1].Donation="Clothes";
ngos[1].YoEst="1999";
ngos[1].Where="Hamirpur";
ngos[1].filter_display="0";
function filter_by_don(key){
for(var i=0;i<ngos.length;i++){
if(ngos[i].Donation.indexOf(key)>=0) //if key will be present in Donation string, the index will be any positive number, else, it returns -1.
{
ngos[i].filter_display="1";
}
}
}