MultiSelect, Angular, ConditionalFormatting

4 posts, 0 answers
  1. Tim R
    Tim R avatar
    131 posts
    Member since:
    Feb 2006

    Posted 25 Sep 2014 Link to this post

    Judging from this demo:

    http://demos.telerik.com/kendo-ui/multiselect/angular

    it seems I would not be able to bind to an array of objects of this type:

       { id: 100,  title: 'foo', expiryDate: [a date or null goes here]}


    and apply some conditional formatting to the dropdown list (e.g. <del>strikethrough</del>)  based on finding a value in expiryDate.

    Is that correct? There can be no conditional formatting with the multiselect based on a property other than display value or bound value?
  2. Alexander Popov
    Admin
    Alexander Popov avatar
    1416 posts

    Posted 29 Sep 2014 Link to this post

    Hi Tim,

    This behavior is possible and could be achieved by specifying a Kendo UI template or a function that should be used for the MultiSelect's tagTemplate and itemTemplate options. Here is an example illustrating how this could be achieved.

    Regards,
    Alexander Popov
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Kendo UI is VS 2017 Ready
  4. Tim R
    Tim R avatar
    131 posts
    Member since:
    Feb 2006

    Posted 29 Sep 2014 in reply to Alexander Popov Link to this post

    Thanks, Alexander. It seems the style that is applied by the tagTemplate appears only after the choice has been made and the dropdown list closes.  But is there a way to show the style while the items are being displayed in the dropdown list?

    Toppings [                                                 ]
                        cheese
                        <del>spinach</del>
                        peppers
                        onions
                        artichoke
  5. Alexander Popov
    Admin
    Alexander Popov avatar
    1416 posts

    Posted 29 Sep 2014 Link to this post

    Hi Tim,

    This is the expected behavior of the tagTemplate option, that is why I recommended using an itemTemplate as well.

    Regards,
    Alexander Popov
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
Back to Top
Kendo UI is VS 2017 Ready