Thanks for reporting, you raise a good point. There is not a better solution than exposing the appropriate functions and obeservables. What usecase are you trying to solve here?
If we can find a proper usecase for this kind of logic we can add a feature request
A Button's (or Panel's more generally) Clicked function will receive an object whose data field contains the data context for the Button, if that’s what you guys are after:
JS:
function handler(arg) {
// arg.data represents the item that was the data context for the button below
}
I understand this example and use it in my app. But I am facing a problem I don’t understand.
arg.data contains my object, but when I try to use it it’s undefined: like this :
function addtobucket(arg) {
dataStore.paniers.add(
{
name: "arg.data.name", // a test
id: arg.data._id, // undefined
price: arg.data.price, // undefined
}
);
console.log("panier contient en JSON --> " + JSON.stringify(arg.data)); // when I try this I can see all the data is here
@Kwame: there are no updates on whatever was discussed here in particular. You should make a new forum post, explaining exactly what it is that you want to do, and we’ll likely figure out a way for you to do it.