Can't set value of RadialGauge in TypeScript project

5 posts, 1 answers
  1. Gustavo
    Gustavo avatar
    23 posts
    Member since:
    Apr 2012

    Posted 30 Jun 2015 Link to this post

    I'm facing a problem when I try to change the Radial Gauge value with the code below in my TypeScript project.

    var gauge = $("#gauge").data("kendoRadialGauge");
    gauge.options.pointer[0].value = Math.random() * 100;

     

    The property 'value' is updated with the new value, but the pointer doesn't move.

    What I'm doing wrong?

     

    Thanks!

  2. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2153 posts

    Posted 03 Jul 2015 Link to this post

    Hello Gustavo,

    The options property contains the initial configuration options of the widget. In order to set the value of the pointers, you should access the pointers property and use the value() method of the specific pointer.
    E.g.

    var gauge = $("#gauge").data("kendoRadialGauge");
    gauge.pointers[0].value(20);

    This is demonstrated in the following demo.

    Regards,
    Dimiter Madjarov
    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. Gustavo
    Gustavo avatar
    23 posts
    Member since:
    Apr 2012

    Posted 03 Jul 2015 Link to this post

    Hi Dimiter, seems that this example does not work for TypeScript or is missing some reference.

    I'm getting this error:​

  5. Answer
    Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2153 posts

    Posted 03 Jul 2015 Link to this post

    Hello Gustavo,

    We will take a look at the issue. Regarding the current case, if the Gauge has only one pointer, you could directly use it's value method and the allValues method if there are multiple pointers.

    Regards,
    Dimiter Madjarov
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  6. Gustavo
    Gustavo avatar
    23 posts
    Member since:
    Apr 2012

    Posted 03 Jul 2015 Link to this post

    Thanks Dimiter! The method allValues solved my problem.

    By the way, I get this error when I use the method value:

Back to Top
Kendo UI is VS 2017 Ready