Listview getting small on binding

2 posts, 0 answers
  1. Simon Maystre
    Simon Maystre avatar
    23 posts
    Member since:
    Aug 2012

    Posted 09 May 2014 Link to this post

    Hello Team,

    I have a project in which I have used list view to show the data. But When I bind the data first time, it works properly, but when bind the data again then it gets small.

    I am using the below code :

      <div id="tabstrip-sales-dashboard" data-role="view" data-title="Sales dashboard" data-model="app.loginService.viewModel" data-show="mobileSalesViewInit" data-stretch="false" >
                    <div data-role="content" class="view-content">

                        <ul id="salesperiod" data-role="buttongroup" data-index="0" style="font: bold 0.76em HelveticaNeue,sans-serif;">
                            <li>Current Week</li>
                            <li>Current Month</li>
                    <span id="spMsg"></span>
                    <p id="paraspMsg"></p>
                    <ul id="ulToday">

    In above code I am binding data to '  <ul id="ulToday"></ul>'.

    This occurs in android. Just I have investigated briefly and I found that when we bind data to listview it creates <div class="listview-wrapper"> and I think It has padding and I think this is why it is causing problem.

    Any help would be appreciated.


  2. Kiril Nikolov
    Kiril Nikolov avatar
    2596 posts

    Posted 09 May 2014 Link to this post

    Hi Simon,

    I can see that you are using the show event to initialize the ListView, when using this event the initialization is called every time you navigate to view, which is not support/recommended and can cause the problem you are facing (creates multiple ListViews along with div.listview-wrapper).

    For initialization you need to use the init event (data-init) which is called just once, so you do not initialize the widget more than once.

    Kiril Nikolov
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top