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

Expand/Collapse Icon Not Changing with set_expanded()

8 Answers 193 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dan
Top achievements
Rank 1
Dan asked on 03 Sep 2015, 04:16 PM

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

Sort by
0
Kostadin
Telerik team
answered on 08 Sep 2015, 12:17 PM
Hello Dan,

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
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Bernie
Top achievements
Rank 1
answered on 06 Nov 2015, 11:48 AM

Hi!

I have the same problem!!! I'm using "NestedTableView"... I tried your sample but the behavior ist the same!

Thank you!
0
Kostadin
Telerik team
answered on 11 Nov 2015, 07:19 AM
Hello Peter,

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
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Bernie
Top achievements
Rank 1
answered on 11 Nov 2015, 09:35 AM

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!

0
Kostadin
Telerik team
answered on 16 Nov 2015, 06:38 AM
Hi Peter,

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
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Bernie
Top achievements
Rank 1
answered on 16 Nov 2015, 08:22 AM

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!

0
Kostadin
Telerik team
answered on 18 Nov 2015, 02:48 PM
Hello Peter,

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
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Bernie
Top achievements
Rank 1
answered on 18 Nov 2015, 03:08 PM

Hello Kostadin!

Thank you!!!!

Peter

Tags
Grid
Asked by
Dan
Top achievements
Rank 1
Answers by
Kostadin
Telerik team
Bernie
Top achievements
Rank 1
Share this question
or