Skip to Content
author's profile photo Former Member
Former Member

Databind from listitem to parent object

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on Sep 12, 2016 at 04:22 AM

    Hi Olav,

    You didn't mention which control are you using for template.

    With a rough assumption, will this sample help? Plunker

    Regards,

    Sai.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Sai

      Thank you for you answer. It's close but unfortunately does not solve my issue i think.

      A little more details about my example:

      The page is bound to the single object i describet above. On the page is a list that uses the "items" collection for its items property. Each element is there by bound to an individual object from the "items" collection.

      Now what i want to do is have a button on each element that has its enable property bound to the same property "status" on the main object. It is a "global" status that controls if users can make changes. (of couse alternative solutions are also welcome 😊)

      Regard Olav

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.