Expand/Collapse Icon Not Changing with set_expanded()

9 posts, 0 answers
  1. Dan
    Dan avatar
    135 posts
    Member since:
    Feb 2011

    Posted 03 Sep 2015 Link to this post

    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()

  2. Kostadin
    Admin
    Kostadin avatar
    1733 posts

    Posted 08 Sep 2015 Link to this post

    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
  3. Bernie
    Bernie avatar
    27 posts
    Member since:
    Apr 2008

    Posted 06 Nov 2015 Link to this post

    Hi!

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

    Thank you!
  4. Kostadin
    Admin
    Kostadin avatar
    1733 posts

    Posted 11 Nov 2015 Link to this post

    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
  5. Bernie
    Bernie avatar
    27 posts
    Member since:
    Apr 2008

    Posted 11 Nov 2015 in reply to Kostadin Link to this post

    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!

  6. Kostadin
    Admin
    Kostadin avatar
    1733 posts

    Posted 16 Nov 2015 Link to this post

    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
  7. Bernie
    Bernie avatar
    27 posts
    Member since:
    Apr 2008

    Posted 16 Nov 2015 in reply to Kostadin Link to this post

    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!

  8. Kostadin
    Admin
    Kostadin avatar
    1733 posts

    Posted 18 Nov 2015 Link to this post

    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
  9. Bernie
    Bernie avatar
    27 posts
    Member since:
    Apr 2008

    Posted 18 Nov 2015 in reply to Kostadin Link to this post

    Hello Kostadin!

    Thank you!!!!

    Peter

Back to Top