-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from pingwang2011/timob-8170
timob-8170: Titanium Mobile Template: Template.MasterDetail: needs a back button on the new opened window
- Loading branch information
Showing
3 changed files
with
47 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
function ApplicationWindow() { | ||
//declare module dependencies | ||
var MasterView = require('ui/common/MasterView'), | ||
DetailView = require('ui/common/DetailView'); | ||
|
||
//create object instance | ||
var self = Ti.UI.createWindow({ | ||
backgroundColor:'#ffffff' | ||
}); | ||
|
||
//construct UI | ||
var masterView = new MasterView(), | ||
detailView = new DetailView(); | ||
|
||
//create master view container | ||
var masterContainerWindow = Ti.UI.createWindow({ | ||
title:'Products' | ||
}); | ||
masterContainerWindow.add(masterView); | ||
|
||
//create detail view container | ||
var detailContainerWindow = Ti.UI.createWindow({ | ||
title:'Product Details' | ||
}); | ||
detailContainerWindow.add(detailView); | ||
|
||
//create Mobile Web specific NavGroup UI | ||
var navGroup = Ti.UI.MobileWeb.createNavigationGroup({ | ||
window:masterContainerWindow | ||
}); | ||
self.add(navGroup); | ||
|
||
//add behavior for master view | ||
masterView.addEventListener('itemSelected', function(e) { | ||
detailView.fireEvent('itemSelected',e); | ||
navGroup.open(detailContainerWindow); | ||
}); | ||
|
||
return self; | ||
}; | ||
|
||
module.exports = ApplicationWindow; |