This is a migrated thread and some comments may be shown as answers.

Listview getting small on binding

1 Answer 77 Views
ListView (Mobile)
This is a migrated thread and some comments may be shown as answers.
Simon Maystre
Top achievements
Rank 1
Simon Maystre asked on 09 May 2014, 12:07 PM
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>
                <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>Today</li>
                        <li>Current Week</li>
                        <li>Current Month</li>
                    </ul>
                </div>
            </div>
 
            <!--<div>-->
                <span id="spMsg"></span>
                <p id="paraspMsg"></p>
                <ul id="ulToday">
                </ul>
            <!--</div>-->
            
        </div>



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.

Thanks



1 Answer, 1 is accepted

Sort by
0
Kiril Nikolov
Telerik team
answered on 09 May 2014, 12:11 PM
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.

Regards,
Kiril Nikolov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
ListView (Mobile)
Asked by
Simon Maystre
Top achievements
Rank 1
Answers by
Kiril Nikolov
Telerik team
Share this question
or