viezel / NappSlideMenu

a new UI component for Appcelerator Titanium
Other
128 stars 34 forks source link

Cannot interact with tableview in sidebar #24

Closed mrosales closed 10 years ago

mrosales commented 10 years ago

I am trying to get a simple app up and running and everything worked well except for the fact that I can't seem to be able to interact with anything in the left sidebar. I slightly modified the sample alloy code that was provided in the readme, changing the center view to a NavigationWindow and adding the left table to a container to deal with the translucent menu bar. (It didn't recognize touches before adding it to the container either.) The tableview will not even scroll, not to mention register cell selection.

<Alloy>
    <Window id="leftWindow">
        <View id="leftContainer">
            <TableView id="leftTable">
                <TableViewRow>
                    <Label text="hello left window"></Label>
                </TableViewRow>
            </TableView>
        </View>
    </Window>
    <NavigationWindow id="navWindow">
        <Window id="win">
            <LeftNavButton>
                <Button title="Left" onClick="openLeft"></Button>
            </LeftNavButton>
            <TableView >
                <TableViewRow>
                    <Label text="hello center window"></Label>
                </TableViewRow>
            </TableView>
        </Window>   
    </NavigationWindow>
</Alloy>

Here is what my .js file looks like:

var NappSlideMenu = require('dk.napp.slidemenu');

var mainWindow = NappSlideMenu.createSlideMenuWindow({
    centerWindow:$.navWindow,
    leftWindow:$.leftWindow,
});

$.leftTable.addEventListener("click", function(e){
    // implement logic
    Titanium.API.info("Sidebar Menu item clicked: " + e);
});

mainWindow.addEventListener("viewWillOpen", function(e) {
    this.setCenterhiddenInteractivity("TouchDisabledWithTapToClose");
});

mainWindow.addEventListener("viewWillClose", function(e) {
    this.setCenterhiddenInteractivity("TouchEnabled");
});

function openLeft(){
    mainWindow.toggleLeftView();
}

mainWindow.open(); //open the app
mrosales commented 10 years ago

Nevermind, I figured out the issue. Kind of dumb on my part! The slide menu window was not my root window (index.xml/js/tss) but rather its view added as a subview. Changing that fixed my issue.

aakashsharmaindore commented 8 years ago

Just check your last pages which u build if its open like you use example 1: $.twoWindoe.open(); and you use Alloy.createController('window').getView().open(); then comment the example 1. it works. check all pages if any window is open on JS then close it.