Client side binding: Treeview not showing

14 posts, 1 answers
  1. Aleksander
    Aleksander avatar
    17 posts
    Member since:
    Mar 2014

    Posted 27 Oct 2014 Link to this post

    Hi,

    I'm having an issue with treeview not displaying any items due to the .rgtTreelistContent is being rendered with style='height: 0'. 
    See attachement for html.
  2. Bozhidar
    Admin
    Bozhidar avatar
    1101 posts

    Posted 30 Oct 2014 Link to this post

    Hi,

    In a simple case of a RadGantt on a page this issue is not observed, as can be seen in our online demos:
    http://demos.telerik.com/aspnet-ajax/gantt/examples/overview/defaultcs.aspx

    The issue seems to be caused by some specific aspect of your setup, so we would need more information on how exactly you've created your Gantt control.

    Regards,
    Bozhidar
    Telerik
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Aleksander
    Aleksander avatar
    17 posts
    Member since:
    Mar 2014

    Posted 31 Oct 2014 in reply to Bozhidar Link to this post

    It is hosted in an aspx page that is hosted inside an iFrame.

    <table class="tfb" cellspacing="1" cellpadding="0" border="0">
    <tr>
    <td>
    <telerik:RadGantt runat="server" ID="RadGantt1" >
    <WebServiceSettings Path="webApiPathGantt" />
    </telerik:RadGantt>
    </td>
    </tr>
    </table>

    Any other info you require?
  5. Bozhidar
    Admin
    Bozhidar avatar
    1101 posts

    Posted 03 Nov 2014 Link to this post

    Hi,

    The Gantt controls uses javascript to resize it's inner tables depending on the available outer container on initial load. It seems that in your case when the Gantt is initially loaded, the container is not fully expanded or visible. Try calling the following method after the control is fully loaded, to force it to recalculate it's dimensions:
    $find("RadGantt1")._widget.resize();


    Regards,
    Bozhidar
    Telerik
  6. Aleksander
    Aleksander avatar
    17 posts
    Member since:
    Mar 2014

    Posted 04 Nov 2014 in reply to Bozhidar Link to this post

    That didnt work. 
    I had to wrap it in a timeout for find to even get the controller.

    Even a high timeout to ensure resize happens after fetch of items didnt help.

     $(document).ready(function () {
            setTimeout(function() {
                var object = $find("<%= RadGantt1.ClientID %>");
                console.log(object);
                object._widget.resize();
            }, 1500);
        });
  7. Bozhidar
    Admin
    Bozhidar avatar
    1101 posts

    Posted 06 Nov 2014 Link to this post

    Hello,

    Could you send a simplified runnable version of your code, so that we can test it locally, as we are not able to reproduce the issue.

    Regards,
    Bozhidar
    Telerik
  8. Aleksander
    Aleksander avatar
    17 posts
    Member since:
    Mar 2014

    Posted 10 Nov 2014 Link to this post

    I'm sorry but I cannot send a full runnable issue. I am not able to reproduce our whole environment easily. And I am not able to reproduce it in this fashion in a side project. I was able to show the treeview partially when I noticed the radscript was only setup in our login form and not our index form (which houses all our iframes). Currently it now looks like the attached image once loaded.

    I was able to reproduce a rather wierd behavior in iframes though. The height doesnt scale well with iframes that start hidden and then are loaded dynamically. (where can I send the project zip file?)
  9. Aleksander
    Aleksander avatar
    17 posts
    Member since:
    Mar 2014

    Posted 10 Nov 2014 Link to this post

    Missed attachment:
  10. Aleksander
    Aleksander avatar
    17 posts
    Member since:
    Mar 2014

    Posted 10 Nov 2014 in reply to Aleksander Link to this post

    Added html screenshot:
  11. Answer
    Bozhidar
    Admin
    Bozhidar avatar
    1101 posts

    Posted 11 Nov 2014 Link to this post

    Hello,

    Could you share what version of the controls you are using? In the latest version (Q3 2014) there were some fixes ot the $find("RadGantt1")._widget.resize(); I proposed earlier, which might be what's missing in your case. 

    Regards,
    Bozhidar
    Telerik
  12. Aleksander
    Aleksander avatar
    17 posts
    Member since:
    Mar 2014

    Posted 11 Nov 2014 in reply to Bozhidar Link to this post

    Im currently on 2014 Q2. Will try to upgrade. 

    I do have an issue with $find("RadGantt1")._widget.resize(); in that _widget is null on document load and is not set untill data is loaded, and I have no way of knowing when that has happened (other than using a fixed timer and that is not good enough)
  13. Bozhidar
    Admin
    Bozhidar avatar
    1101 posts

    Posted 13 Nov 2014 Link to this post

    Hello,

    You mentioned your Gantt is located inside an iFrame. If that is the case, place the code on the page containing the Gantt, that way when the document load event hits (for the page with the gantt), the widget will be initialized.

    Regards,
    Bozhidar
    Telerik
  14. Aleksander
    Aleksander avatar
    17 posts
    Member since:
    Mar 2014

    Posted 13 Nov 2014 in reply to Bozhidar Link to this post

    Updating to the Q3 release seems to solve all these issues in one go without having to do anything custom. Thank you :)

    Will there be coming more client side hooks?
    Fes manual triggering reloading items from server.

    Im looking to creating some limitations on search dates in the page using the Gantt and then I need to reload all data. Would be nice to be able to do this without doing a full postback of the page. (WebForms)
  15. Bozhidar
    Admin
    Bozhidar avatar
    1101 posts

    Posted 14 Nov 2014 Link to this post

    Hello,

    I'm glad the issue was resolved for you. We will continue to develop and improve the Gantt control, so keep track of our release notes for any additions to its functionality. Since the issue from this forum post was resolved, I am going to mark it as closed.

    Regards,
    Bozhidar
    Telerik
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017