Grid not maintaining height

6 posts, 2 answers
  1. Grant
    Grant avatar
    42 posts
    Member since:
    Jul 2016

    Posted 09 Sep Link to this post

    Hi,

    I wasnt sure what category this question belongs as I dont know if the issue is Grid or DataSource related. So here it is.

    I've created a kendoWindow that contains a KendoGrid with a height of 350px. The problem Im having is that the Grid is not maintaining the height (and impl scroll overflow) when the window is opened multiple times.

    Here is the code, (apologies for its length, Im this one bug away from it being complete) http://dojo.telerik.com/uCayI

    The problem persists regardless of is the dataSource is static or remote.

    You can see the bug if you run the code then open either of the windows mulitple times, you'll see the lower buttons vanish.

    Please ask if anything is unclear.

    Regards, 
    Grant

  2. Answer
    Rumen
    Admin
    Rumen avatar
    12851 posts

    Posted 09 Sep Link to this post

    Hi Grant,

    The reported behavior is due to that JavaScript size calculations don't work for hidden elements. The issue is explained in the following help article: Hidden Containers along with guidance how to solve it.


    Best regards,
    Rumen
    Telerik by Progress
     
    Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
     
  3. Kendo UI is VS 2017 Ready
  4. Grant
    Grant avatar
    42 posts
    Member since:
    Jul 2016

    Posted 09 Sep in reply to Rumen Link to this post

    Hi Rumen, 

    This was perfect, thank you!

    So I've moved the initialization of the grid from window.open to window.activate, this way the window template will have loaded and the Grid's DIV will be visible (if still empty).

    My other issue is that since Im appending the generated DIV to the <body /> its placed at the bottom of the page. This normally isnt an issue as I simple call window.centre() and all is well, however the body is about screen height now so when I call window.center(), the window is horizontally centered but not vertically. I've updated the example to demo this, http://dojo.telerik.com/uCayI/4.

    I'd appreciate any advise you can provide.

    Thanks,
    Grant

  5. Answer
    Rumen
    Admin
    Rumen avatar
    12851 posts

    Posted 13 Sep Link to this post

    Hi Grant,

    Actually, there's no need to center() the Window in the Grid's dataBound event. This can be done immediately before opening, if the Grid height style is applied to the Grid as shown at:

    http://dojo.telerik.com/uCayI/5

    From better UX, it is recommended to destroy a Window in its deactivate event, and not immediately after closing it, so that the closing animation is complete.

    Best regards,
    Rumen
    Telerik by Progress
     
    Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
     
  6. Grant
    Grant avatar
    42 posts
    Member since:
    Jul 2016

    Posted 13 Sep in reply to Rumen Link to this post

    Thanks Rumen,

    You've been a big help with this widget. I just have one last question about your reply;

    From better UX, it is recommended to destroy a Window in its deactivate event, and not immediately after closing it, so that the closing animation is complete.

    How is the UX improved by destroying the window during deactivate instead of close? Is it simply that the kendoWindow runs smoother or is it something more significant?

    Thanks again, 
    Grant

  7. Rumen
    Admin
    Rumen avatar
    12851 posts

    Posted 13 Sep Link to this post

    Thanks for the nice words, Grant!

    It's all about the animation and nothing else.

    Regards,
    Rumen
    Telerik by Progress
     
    Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
     
Back to Top
Kendo UI is VS 2017 Ready