Skip to Content
0
Sep 10, 2016 at 10:52 PM

Databind from listitem to parent object

37 Views

Hi everyone,

Here is what i am facing:

I have an object like this:

{

"status" : "open",

"items" : [{"title" : "Item 1"}, {"title" : "Item 2"}, {"title" : "Item 3"}]

}

Now i want to show a list of the elements in the "Items" collection. Each list item will have a button that will trigger some logic that should only be available while "status" is "open". So what i would like to do is hide the button when status changes to something else.

This is what i am having trouble with: How do i bind the enabled property on the list item to the "status" property on the parent element?

Any input / suggestion will be greatly appreciated!

Best regards,

Olav