我的剑道网格有以下 rowTemplate:
<script id="gridTemplate" type="text/x-kendo-template">
<tr data-uid="#= uid #">
<td>
<input type="color" kendo-color-picker k-palette="controller.colors" value="'#=color#'" on-change="controller.changeColor()" />
</td>
</tr>
我的问题是我想从dataItem.color
属性中设置颜色选择器的值。使用上面的语法,我收到以下消息:
The specified value "'#0000ff'" does not conform to the required format. The format is "#rrggbb" where rr, gg, bb are two-digit hexadecimal numbers.
如果我将其更改为value="#=color#"
(不带单引号),那么我得到:
Error: [$parse:lexerr] Lexer Error: Unexpected next character at columns 0- 0 [#] in expression [#00ff00].
http://errors.angularjs.org/1.4.0/$parse/lexerr?p0=Unexpected%20next%20character%20&p1=s%200-0%20%5B%23%5D&p2=%2300ff00
Cause: <input type="color" kendo-color-picker="" k-palette="trend.colors" value="#00ff00" on-change="trend.changeColor()">
{anonymous}()@columns 0-0 [#] in expression [#00ff00].
{anonymous}() (http://errors.angularjs.org/1.4.0/)$parse/lexerr?p0=Unexpected%20next%20character%20&p1=s%200-0%20%5B%23%5D&p2=%2300ff00
我试图在角度代码中移动模板并使用function(dataItem)
,但结果是同样的错误。任何帮助都感激不尽。