How to set kendo color picker value inside in a kendo template

2 posts, 0 answers
  1. zhivko.zhelezov
    zhivko.zhelezov avatar
    31 posts
    Member since:
    May 2011

    Posted 20 Nov 2015 Link to this post

    Hi folks,

     I am having the following column template :

    <script id="gridTemplate" type="text/x-kendo-template">
        <tr data-uid="#= uid #">
            <td>
                <input type="color" kendo-color-picker="colorPicker" k-palette="trend.colors" value="#= color #" on-change="trend.changeColor(colorPicker.value(), this)" />
                <button type="button" style="background-color:black; float:right;" class="btn btn-default btn-xs white" ng-click="trend.deleteSeries('#= tag#');"><span class="glyphicon glyphicon-remove"></span></button>
            </td>
            <td>
                #= tag#
            </td>
            <td>
                #= description#
            </td>
            <td>
                #= unit#
            </td>
        </tr>
    </script>

    The problem is with setting the color of the color picker (via the value attribute) in the first column.Initially in the dataItem, the value of color was in the form of #rrggbb, but this was resulting in an error (because of the "#" symbol). I changed it in rgba() and it was working fine with 2014 kendo release. Today I update to 2015 and now it does not work. Any suggestion how to fix it?

  2. Daniel
    Admin
    Daniel avatar
    2117 posts

    Posted 25 Nov 2015 Link to this post

    Hello,

    Could you clarify how is the provided template used? If you are using angular then could you check if setting the value as option:
    <input kendo-color-picker="colorPicker" k-value="'#=color#'" />
    or binding it to the item:
    <input kendo-color-picker="colorPicker" ng-model="dataItem.color" />
    helps.

    Regards,
    Daniel
    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
Back to Top