Using the latest SP of 2015.2.
I have a Hierarchy RadGrid with the following options set:
HierarchyLoadMode="Client"
and
<ClientEvent​s OnRowClick="expandCollapseRow" />
Then in Javascript:
function expandCollapseRow(sender, args)
{
var item = args.get_item();
item.set_expanded(!item.get_expanded());
}
This works great - but if I don't click on the Expand/Collapse Icon directly - the icon does not change. I think this may be a bug with set_expanded()
8 Answers, 1 is accepted
Thank you for contacting us.
I am afraid I was unable to replicate the issue locally. Please check out the attached sample which uses the same approach as the one you have shown but in my sample the expand/collapse icon is changed. Could you please let me know how it differs from your real setup?
Regards,
Kostadin
Telerik
Hi!
I have the same problem!!! I'm using "NestedTableView"... I tried your sample but the behavior ist the same!
I tried using a NestedViewTemplate and on my side the expand collapse images are changes. Could you please check out the attached sample and let me know how it differs from your real setup? I would appreciate if you can replicate it issue either in my sample or in a small runnable one in order to investigate it further.
Regards,
Kostadin
Telerik
Hello Kostadin...
I tried your sample but the issue is still the same ... I attached a picture to describe my problem! I'm using the version 2015.2.623.45.
Thank you!
I prepared a video where you can see that the sample works properly on my end with the same version of the controls. Nevertheless, could you please check for any client side exception which might prevent changing the icons? Also could you please verify that you are not using any custom styles on the page?
Regards,
Kostadin
Telerik
Hi Kostadin!
Thank you for your video ...
I figured out that the reason ​was the renderMode ... by default I set it to lightweight ... after setting back to classic it works...
Thank you very much!
It looks like a bug in Lightweight rendering of the grid. I logged it in our system and also create an item in our Ideas&Feedback portal to track the progress. Meanwhile you can manually change the icons when you expand/collapse an item. Please check out the following code snippet.
<script type=
"text/javascript"
>
function
expandCollapseRow(sender, args) {
var
item = args.get_gridDataItem();
if
(item.get_expanded() ===
false
) {
$(item.get_element()).find(
".rgExpandIcon"
).removeClass(
"rgExpandIcon"
).addClass(
"rgCollapseIcon"
);
}
else
{
$(item.get_element()).find(
".rgCollapseIcon"
).removeClass(
"rgCollapseIcon"
).addClass(
"rgExpandIcon"
);
}
item.set_expanded(!item.get_expanded());
}
As a token of gratitude for your help to find the bug your Telerik points have been updated.
Regards,
Kostadin
Telerik
Hello Kostadin!
Thank you!!!!
Peter