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

How to hide a drawer element dynamically

2 Answers 337 Views
Drawer (Mobile)
This is a migrated thread and some comments may be shown as answers.
jmillar
Top achievements
Rank 1
jmillar asked on 12 Feb 2015, 06:52 PM
I have a declaratively specified list of drawer options:

<ul data-role="listview" id="tabletDrawer" data-click="drawerClick">
    <li>
        <a href="views/oc.html" data-icon="fa-calculator">Order Calculator</a>
    </li>
    <li>
        <a href="views/oc.html" data-icon="fa-refresh">Reset</a>
    </li>
    <li>
        <a href="views/settings.html" data-icon="spc-settings">Settings</a>
    </li>
    <li>
        <a href="#logView" data-icon="spc-log">Log</a>
    </li>
    <li>
        <a href="skunkworks.html" data-icon="spc-settings">IT Development Area</a>
    </li>
    <li>
        <a href="debug.html" data-icon="spc-settings" class="spc-debug">IT Debug Info</a>
    </li>
</ul>


How can I remove one of them at runtime (for example, if I wanted to remove an item from the list based on a setting in a build configuration).

Thanks,
Jason

2 Answers, 1 is accepted

Sort by
0
Petyo
Telerik team
answered on 16 Feb 2015, 09:31 AM
Hello,

if I understand you correctly, you are using a listview widget inside the drawer. The listview does not expose an API for removing non-databound list items, but you can do that using the jQuery remove method, or the standard DOM removeChild method. 

Regards,
Petyo
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
jmillar
Top achievements
Rank 1
answered on 17 Feb 2015, 12:36 PM
Hi Petyo;

Thanks, that worked - I had initially tried that but wound up with an artifact where the item would have been and had to just use the jQuery parent selector to also remove some of the chroming that Kendo puts around the list item.

Thanks again,
Jason
Tags
Drawer (Mobile)
Asked by
jmillar
Top achievements
Rank 1
Answers by
Petyo
Telerik team
jmillar
Top achievements
Rank 1
Share this question
or