Escaping brackets in MVVM data attributes

4 posts, 0 answers
  1. Michael
    Michael avatar
    46 posts
    Member since:
    Dec 2010

    Posted 10 Oct Link to this post

    I have a kendoDropDownList, and want the option label to be "[Please Select]", but the brackets are causing binding issues.  I was able to get the first bracket to appear by escaping it with "\[Please Select", but I can't get the 2nd one to escape.  I tried a one and two backslashes before "]".  What is the trick that I'm missing?  Thanks!

    My full element markup:

    <input id="OpportunityType" 
    data-role="dropdownlist" 
    data-auto-bind="false"
    data-text-field="name"
    data-value-field="opportunityTypeKey"
    data-option-label="\[Please Select\]"
    data-bind="value: selectedOpportunityType, source: opportunityTypes, events: { change: onOpportunityTypeChange }" />

     

  2. Dimitar
    Admin
    Dimitar avatar
    225 posts

    Posted 12 Oct Link to this post

    Hello Michael,

    We will need more time to investigate the exact cause for this behavior. I will update you with more details as soon as possible.

    As a workaround for the time being, you can use the approach from this Dojo example, where using a zero-width non-joiner seems to fix the behavior:
    data-option-label="‌&zwnj;[ Select Product ]"

    Regards,
    Dimitar
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. Michael
    Michael avatar
    46 posts
    Member since:
    Dec 2010

    Posted 12 Oct in reply to Dimitar Link to this post

    I'll bring that back to my team, and use it for now.  I monitor release notes, but if you end up fixing it in a future release, please post here if you happen to remember.  Thanks for the response!
  4. Dimitar
    Admin
    Dimitar avatar
    225 posts

    Posted 16 Oct Link to this post

    Hello Michael,

    We have further investigated the issue and I have logged this as a bug in the Kendo UI MVVM. You can start tracking the progress that we make on it from this GitHub issue.

    Also, as a small token of gratitude for helping us discover this bug, I have updated your Telerik points accordingly.

    Regards,
    Dimitar
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top