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

Drawer with dynamic listView

3 Answers 526 Views
Drawer (Mobile)
This is a migrated thread and some comments may be shown as answers.
florim
Top achievements
Rank 1
florim asked on 24 Jul 2013, 09:41 PM
If i populate list inside drawer through viewmodel then the drawer has some strange behavior (it close then it opens and again it close):
but if I do it with the static li items than it works perfectly.


the viewmoldel, drawer layout and templateItem

define(function () {
    return {
        viewModel: {
            routes: [
                { url: '#about-view', name: 'Menu' },
                { url: '#customer-view', name: 'Customer' },
                { url: '#fivatCategory-view', name: 'Fi Vat Category' }]
        }
    };
});
    <script id="menu-list-template" type="text/x-kendo-template">        
        <li data-icon="inbox"><a href="${url}" data-transition="none">${name}</a></li>
    </script>

<div data-role="drawer" id="my-drawer" data-model="app.menuView.viewModel" style="width: 270px" data-title="Menu" data-views="['about-view','customer-view', 'fivatCategory-view']">
        <header data-role="header">
            <div data-role="navbar">
                <span data-role="view-title"></span>
            </div>
        </header>
        <ul data-role="listview" data-type="group">
            <li>Navigation
                <ul data-bind="source: routes" data-template="menu-list-template"> <!-- when this is bound through viewmodel  --!>
                </ul>

            </li>
            <li>Einstellungen
            <ul>
                <li data-icon="spam"><a href="#drawer-spam" data-transition="none">Spam</a></li>
                <li data-icon="spam"><a href="#fivatCategory-view" data-transition="none">Fi VAT 2nd Try</a></li>
                <li>Leistungen</li>
            </ul>
            </li>
            <li>Account
            <ul>
                <li data-icon="settings">Logging</li>
                <li data-icon="off">Log Out</li>
            </ul>
            </li>
        </ul>
    </div> 

3 Answers, 1 is accepted

Sort by
0
Alexander Valchev
Telerik team
answered on 26 Jul 2013, 12:06 PM
Hi Florim,

I tested a similar scenario in jsBin but did not manage to reproduce the behaviour you described. Could you please check the sample and let me know what I am missing?
Thank you in advance.

Regards,
Alexander Valchev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
florim
Top achievements
Rank 1
answered on 26 Jul 2013, 01:38 PM
I did figure it out: In my application start i remove transaction
transition: "fade" and that behavior it disappear. 

from:
    new kendo.mobile.Application(document.body, { transition: "fade"});// try with this and you will see that behavior.
now:
    new kendo.mobile.Application(document.body); // is OK

Sorry for my English.
0
Petyo
Telerik team
answered on 29 Jul 2013, 09:14 AM
Hello florim,

I am sorry for the inconvenience caused - the drawer links should not have transitions. You can override the default transition by setting data-transition="none" to them. The dynamic binding issue is also related to a bug we fixed recently.

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