This question is locked. New answers and comments are not allowed.
Hello there, I am trying to add a SideDrawer that opens below the ActionBar, declaring a normal Page and adding the SideDrawer as its child but seems like I am doing something wrong, this is my xml code:
<Page xmlns:navigation="navigation/example-drawer-page" navigatingTo="onNavigatingTo" xmlns:drawer="nativescript-telerik-ui-pro/sidedrawer" xmlns:lv="nativescript-telerik-ui-pro/listview" xmlns="http://www.nativescript.org/tns.xsd"> <ActionBar title="Dashboard"> <NavigationButton visibility="collapsed"/> <android> <NavigationButton icon="res://ic_menu" tap="openMainMenu" /> </android> <ios> <ActionItem icon="res://ic_menu" ios.position="left" tap="openMainMenu" /> </ios> <ActionItem ios.systemIcon="13" android.systemIcon="ic_menu_refresh" ios.position="right"></ActionItem> </ActionBar> <drawer:RadSideDrawer id="mainMenuDrawer" gesturesEnabled="true" drawerContentSize="300"> <drawer:RadSideDrawer.drawerContent> <StackLayout cssClass="drawerContent"> <StackLayout cssClass="headerContent"> <Label text="Main Menu"/> </StackLayout> <ScrollView> <StackLayout cssClass="drawerMenuContent"> <Label text="Logout" tap="onLogoutTap" cssClass="drawerSectionItem" /> </StackLayout> </ScrollView> </StackLayout> </drawer:RadSideDrawer.drawerContent> </drawer:RadSideDrawer> <GridLayout rows="50 *" columns="*"> <StackLayout row="0" col="0"> <Label text="First View" textWrap="true" /> </StackLayout> <lv:RadListView items="{{ dataItems }}" row="1"> <lv:RadListView.listViewLayout> <lv:ListViewLinearLayout scrollDirection="Vertical"/> </lv:RadListView.listViewLayout> <lv:RadListView.itemTemplate> <StackLayout orientation="vertical"> <Label fontSize="20" text="{{ itemName }}"/> <Label fontSize="14" text="{{ itemDescription }}"/> </StackLayout> </lv:RadListView.itemTemplate> </lv:RadListView> </GridLayout></Page>
When I get the Drawer in my js file like this:
exports.openMainMenu = function(args) { var mainMenuDrawer = page.getViewById("mainMenuDrawer"); mainMenuDrawer.toggleDrawerState();}I get an exception 'toggleDrawerstate' of undefined. Seems like is not finding the Drawer in the page.
Am I missing something?
Thanks!