PivotGrid Template cannot access measure field on single measure

3 posts, 1 answers
  1. The Cowboy
    The Cowboy avatar
    19 posts
    Member since:
    Mar 2010

    Posted 11 Feb Link to this post

    I'm unable to access the measure field in a dataCellTemplate when it's by itself and a column dimension is set. measure returns undefined. How can I determine the measure in this scenario?

    Please see examples from dojo. 

    Thanks, 

  2. Answer
    Georgi Krustev
    Admin
    Georgi Krustev avatar
    3707 posts

    Posted 15 Feb Link to this post

    Hello,

    Currently, the widget passes the measure name when there are more then one measures applied. When a single measure is set, then it is known and the template information does not contain the measure name.

    To workaround this behavior, you will need to get the measure information from the PivotGrid datasource component:
    <script id="dataCellTemplate" type="text/x-kendo-template">
        # var pivotgrid = $("\#pivotgrid").data("kendoPivotGrid"); #
        # measure = measure || pivotgrid.dataSource.measures()[0]; #
        # if(measure) { #
        # console.log(measure.name); #
        # } #
        #: dataItem.value #
    </script>

    Regards,
    Georgi Krustev
    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. The Cowboy
    The Cowboy avatar
    19 posts
    Member since:
    Mar 2010

    Posted 16 Feb in reply to Georgi Krustev Link to this post

    Worked perfectly.

    Thanks

Back to Top