javascript - How to call a function in kendo -


i format mt x axis label via calling method follows:

xaxis: {    labels: {      template: "#=  shortlabels(value) #"       }, }   function shortlabels(value) {     var strvalue = kendo.tostring(value)     strvalue = strvalue + "";     strvalue = strvalue.substring(1)     return strvalue; } 

however getting

shortlabels not defined error

basically not call method.

http://jsfiddle.net/3yhbyy2g/31/

you can set function in kendo-template. isn't beauty, know, works:

<script id="labeltemplate" type="text/x-kendo-template">     #     var strvalue = kendo.tostring(value)     strvalue = strvalue + "";     strvalue = strvalue.substring(1);     #     #= strvalue # </script> 

and in chart property:

labels: {     template: kendo.template($("#labeltemplate").html()) } 

fiddle.


Comments

Popular posts from this blog

shopping cart - Page redirect not working PHP -

php - How to modify a menu to show sub-menus -

python - Installing PyDev in eclipse is failed -