on 02-18-2014 8:54 AM
Hi,
I have a question relating filtering/binding of different sub-trees to ONE table.
I have a model, where I store "activities" under each "customer"'s node, e.g
[CUSTOMER_4711]
[ACTIVITIES-A]
[ACTIVITIES-B]
[ACTIVITIES-C]
[CUSTOMER_0815]
[ACTIVITIES-D]
[ACTIVITIES-E]
[ACTIVITIES-F]
So each customer node got [0...n] activities.
When I navigate trough the model I can use my customer binding context to display all activities link to this customer.
Fine so far!
My challenge is now, that I want to create an other screen with an table, where I can see ALL activities of ALL customer.
My current approch is, to traverse the complete model and create a temporary model.
I wonder, if there is an other solution to adchive this 🙂
Cheers
Jens
my favorite 🙂
var JSONData = [{
name: "CUSTOMER_4711",
activites: [{
name: "ACTIVITIES-a"
}, {
name: "ACTIVITIES-b"
}, {
name: "ACTIVITIES-c"
}]
}, {
name: "CUSTOMER_0815",
activites: [{
name: "ACTIVITIES-d"
}, {
name: "ACTIVITIES-e"
}, {
name: "ACTIVITIES-f"
}]
}];
Object.defineProperty(JSONData, "AllActivites", {
get: function () {
return $.map(JSONData,
function (val, i) {
return val.activites;
});
}
});
console.log(JSONData.AllActivites);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Maksim,
how to I bind the object to an table?
Sorry, I dont't understand your code 🙂
Jens
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.