This is a migrated thread and some comments may be shown as answers.

Refreshing TreeMap with angularjs

3 Answers 93 Views
TreeMap
This is a migrated thread and some comments may be shown as answers.
Andrey
Top achievements
Rank 1
Andrey asked on 23 Oct 2015, 10:57 AM

I have TreeMap on my page as directive:

<div kendo-treemap="kTree" k-options="widget.options" k-rebind="widget.options"  style="height:{{widget.options.height-30}}px;"></div>

Sometimes i should change size of widget. â€‹But when i change height and width and call 

.scope().kTree.resize()

it's nothing happens. Does it ridht way? How i can dynamicly change size of TreeMap?

Thanks.

3 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 27 Oct 2015, 09:54 AM
Hello Andrey,

If the size of the element is changed by changing a field in the options then please check this example and let me know if I as missing something. From the code it seems that k-rebind is used and the height field is in the options so the treemap should automatically be recreated and the calling resize should not be needed.

Regards,
Daniel
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Andrey
Top achievements
Rank 1
answered on 20 Nov 2015, 05:39 AM
Hi, Daniel.
Your example works, but I need to make it work with static data not loaded from somewhere.
Here in my example ( http://dojo.telerik.com/ovuDO ) I copied the JSON string directly to the scripts section, and as you can see now treemap doesn't redraw itself correctly.
Is this a bug and how can I make it work?
0
Daniel
Telerik team
answered on 23 Nov 2015, 01:27 PM
Hello again,

The approach will not work for local data because the treemap will be rebound before the element height is updated. In this case you could  implement a custom directive that calls the resize method after setting the new height(example) or use a timeout to call the resize method.

Regards,
Daniel
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
TreeMap
Asked by
Andrey
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Andrey
Top achievements
Rank 1
Share this question
or