kunlee
kunlee

Reputation: 641

Nativescript Module 'nativescript-ui-sidedrawer' not found for element 'nativescript-ui-sidedrawer:RadSideDrawer

i would like to add nativescript side drawer to my project, but i'm getting an error

An uncaught Exception occurred on "main" thread.
Calling js method onClick failed
Error: Building UI from XML. @home/home-page.xml:15:9
 > Module 'nativescript-ui-sidedrawer' not found for element 'nativescript-ui-sidedrawer:RadSideDrawer'.
   > Class extends value undefined is not a constructor or null

i have worked with it before on a previous project and i didn't get this error

this is my XML code below

<GridLayout rows="*" height="100%"
        xmlns:nsDrawer="nativescript-ui-sidedrawer">
        <nsDrawer:RadSideDrawer drawerTransition="PushTransition" id="sideDrawer" rows="0">
            <nsDrawer:RadSideDrawer.drawerContent>
                <StackLayout backgroundColor="white">
                    <StackLayout backgroundColor="#00b47e" height="200" width="100%">
                            
                    </StackLayout>
                </StackLayout>
            </nsDrawer:RadSideDrawer.drawerContent>
            <nsDrawer:RadSideDrawer.mainContent>
                <StackLayout>
                <GridLayout rows="auto, *" columns="auto">
                    <Label text="14 Markets Listed" color="#B5B5B5" fontSize="14" class="indication" row="0" column="0" />
                   <lv:RadListView row="1" column="0" loaded="onListLoaded" loadOnDemandMode="Auto" items="{{ dataItems }}" loadMoreDataRequested="{{ onLoadMoreItemsRequested }}" separatorColor="transparent" itemTap="onItemTap" marginRight="-2" backgroundColor="#e6e6e6" itemLoading="{{ onItemLoading }}">
                                        <lv:RadListView.listViewLayout>
                                            <lv:ListViewLinearLayout scrollDirection="Vertical" dynamicItemSize="false" itemInsertAnimation="Scale" itemDeleteAnimation="Scale" spanCount="2" />
                                        </lv:RadListView.listViewLayout>
                                        <lv:RadListView.itemTemplate>
                                            <GridLayout class="list-group-item" rows="auto" columns="auto, *">
                                                <StackLayout verticalAlignment="center" horizontalAlignment="center" class="thumb">
                                                <Label row="0" verticalAlignment="center" horizontalAlignment="center" col="0" text="A" class="img-rounded" />
                                                </StackLayout>
                                                <StackLayout row="0" col="1" >
                                                    <Label text="{{ name }}" class="list-group-item-heading" />
                                                    <Label text="{{ Location }}" class="list-group-item-text" />
                                                </StackLayout>
                                            </GridLayout>
                                        </lv:RadListView.itemTemplate>
                                    </lv:RadListView>
                                    </GridLayout>
                </StackLayout>
            </nsDrawer:RadSideDrawer.mainContent>
        </nsDrawer:RadSideDrawer>
    </GridLayout>

Please help, thanks

Upvotes: 0

Views: 363

Answers (1)

David
David

Reputation: 598

Well, have you added side drawer to your project?

tns plugin add nativescript-ui-sidedrawer

Yes, it's obvious, but I've made similar oversights :-)

Upvotes: 1

Related Questions