List-View width getting reduced on every click in Android

8 posts, 0 answers
  1. Sowmya
    Sowmya avatar
    4 posts
    Member since:
    Dec 2012

    Posted 19 Aug 2013 Link to this post

    Hi,
           Width of the List-view gets reduced on every click in Android(tested in S3),PFA the sample project.
    Version Used: KendoUIMobile.2013.2.716.Commercial.

    Regards,
    Sowmya
  2. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2564 posts

    Posted 20 Aug 2013 Link to this post

    Hello Sowmya,

    I have reviewed your project and the problem comes from the fact that you are removing the data in the ListView using the .html() jQuery method. This does not remove the widget itself, but the html elements, so when you go back and forth it creates ListView over a ListView. This causes the behaviour in Android and in iOS it causes a performance issue - after a few clicks the app becomes unresponsive.

    You can remove the ListView using its built-in .destroy() method. Or you can implement dataSource that you can use to bind(change) the data in the ListView, based on the desired functionality.
     
    Regards,
    Kiril Nikolov
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Kendo UI is VS 2017 Ready
  4. Sowmya
    Sowmya avatar
    4 posts
    Member since:
    Dec 2012

    Posted 21 Aug 2013 Link to this post

    Hi,
    Thanks for your reply.
    Tried the following code but still facing the same issue,
            Added  var listView = $("#idList").data("kendoMobileListView");
              listView.destroy();
    and removed the $("#idList").html("")
    P.S:The same code was working fine in the previous version of kendo release(v2013.1.514)

    Regards,
    Sowmya
  5. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2564 posts

    Posted 23 Aug 2013 Link to this post

    Hi Sowmya,

    The problem comes from the fact that the ListView is nested inside the "clsDivList" multiple times, which causes the ListView to shrink as the div is nested inside. The whole approach you are using might not be the optimal one. Do you necessarily need to use only one view in your application? Please take a look at the Hierarchical ListView  demo on our side, as it might help you getting started with your application:

    http://demos.kendoui.com/mobile/listview/hierarchical-databinding.html
     
    Regards,
    Kiril Nikolov
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  6. Sowmya
    Sowmya avatar
    4 posts
    Member since:
    Dec 2012

    Posted 27 Aug 2013 Link to this post

    Hi,
    Thanks for your reply.
              As Hierarchical list view is the latest feature,We were using only one view and we do not have enough time in between  to change the complete list  to hierarchical list now.Is there any other alternate way to avoid this issue,so that we can continue with this approach?
            Please reply asap.Thanks in advance.

    Regards,
    Sowmya


  7. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2564 posts

    Posted 29 Aug 2013 Link to this post

    Hello Sowmya,

    First of all I would like to apologize for the delayed answer.

    As you do not want to change to Hierarchical ListView, I can see that you are using static date and templates alon with the same value property. This is why I would suggest you to just change the dataSource of the ListView based on the requirements and the data that you want to show. Please take a look at the following example:

    http://jsbin.com/AjeXojA/2/
     
    Regards,
    Kiril Nikolov
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  8. akshay
    akshay avatar
    7 posts
    Member since:
    Dec 2012

    Posted 30 Aug 2013 Link to this post

    Hi Nikolov,

    I am trying to bind the Hierarchical datasource to listview.
    I am using the latest kendoui.mobile.2013.2.716 version.

    I can see only the root element and not able to navigate to child elements on click of the list item.
    PFA the sample application.

    Is it not possible to navigate to child elements when we bind hierarchical datasource to listview ?

    Any help is appreciated.

    Thanks,
    Akshay
  9. Petyo
    Admin
    Petyo avatar
    2438 posts

    Posted 03 Sep 2013 Link to this post

    Hello Akshay,

    In order for a child navigation to occur, certain template markup and listview rebinding needs to be applied. Please check this demo for a functional example.

    Regards,
    Petyo
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top
Kendo UI is VS 2017 Ready