Built Application Example(Merge sample with component behind items)
var app = NEST.create("com.nxstinc.nest.component.Application", "app");
var __ns = {
app : app,
main : {},
};
var onCreate_main = function(prevForm, __params) {
if (__ns.main.main !== undefined)
return __ns.main.main;
var form = __ns.main.main = NEST.create("com.nxstinc.nest.component.Form", "main");
app.add(form);
form.prevForm = prevForm;
form.__attrs = 3;
form.__params = __params;
//console.log(__params);
var imagetable1 = __ns.main.imagetable1 = NEST.create("com.nxstinc.nest.component.data.ImageTable", "imagetable1");
form.add(imagetable1);
imagetable1.form = form;
imagetable1.data = [{"date":1.414136588E12,"name":"icon.png","path":"assets/system/icon.png","size":140706.0},{"date":1.414136588E12,"name":"landscape.png","path":"assets/system/landscape.png","size":60747.0},];
var myalert1 = __ns.main.myalert1 = NEST.create("com.nxstinc.nest.component.example.MyAlert", "myalert1");
form.add(myalert1);
myalert1.form = form;
var header1 = __ns.main.header1 = NEST.create("com.nxstinc.nest.component.Header", "header1");
form.add(header1);
header1.form = form;
var mybutton1 = __ns.main.mybutton1 = NEST.create("com.nxstinc.nest.component.example.MyButton", "mybutton1");
header1.add(mybutton1);
mybutton1.form = form;
var mypanel1 = __ns.main.mypanel1 = NEST.create("com.nxstinc.nest.component.example.MyPanel", "mypanel1");
form.add(mypanel1);
mypanel1.form = form;
mypanel1.style = {"background-color":"#ff8000"};
mypanel1.size = {width : "100%", height : "50%", "min-height" : "20px"};
var mylabel1 = __ns.main.mylabel1 = NEST.create("com.nxstinc.nest.component.example.MyLabel", "mylabel1");
mypanel1.add(mylabel1);
mylabel1.form = form;
mylabel1.dataText = "name";
// referenced properties
mylabel1.dataStore = imagetable1;
// events
mybutton1.bind("onTap", function(ev) {
myalert1.alert(arguments);
imagetable1.take(arguments);
});
form.bind("onDestroy", function(ev) {
__ns.main = { create : onCreate_main };
});
return form;
}
/* app start */
$(document).ready(function(ev) {
NEST.env.app.id = "com.user.NEST2";
NEST.env.app.name = "NEST2";
NEST.env.app.version = "1.0.0";
NEST.env.app.date = "2015-10-06T10:31:10Z";
NEST.env.app.host = "http://localhost";
NEST.env.app.nativeApp = true;
__ns.main.create = onCreate_main;
__Nav.init(onCreate_main());
// app start
app.run();
if (app.debug) console.log(__ns);
});