Hello everybody
I have this code:
//multiview
{
//gravity:3,
view:"multiview",
cells:[
//scroll view errors
{
view: 'layout',
type: 'wide',
id: 'ewmon_layout_main_content_errors_1',
rows: [
{
view: 'scrollview',
scroll:"y",
id:'ewmon_scroll_main_content_errors_1',
content:{
view: 'layout',
type: 'wide',
id: 'prueba',
rows:[{
view:"toolbar",
type:"none",
elements:[{view:"label", label:"domain goew here"}]
}]
}
}
]
},
...........
when I click on a button I should rebuild the layout “prueba” to generate something with this structure:
scroll[
toolbar1,
dataview1,
toolbar2,
dataview2,
toolbar3,
dataview3,
toolbar4,
dataview4,
…
]
so I wrote this code:
$$('prueba').define("rows", content);
$$('prueba').reconstruct();
where the content array is built recursivly by calling these 2 methods and pushing them into the array “content”:
var buildToolbar = function(domainId,domainCompany) {
var data = {
view:"toolbar",
type:"none",
elements:[{view:"label", label:domainId + " ("+domainCompany+")"}]
}
return data;
}
var buildDataview = function(domainName,size) {
var data = {
view:"dataview",
height:50,
type:{
template:"<span class='dhx_strong'>#type#</span><span class='dhx_light'>#number#</span>",
height:30,
width:20
},
url:"data/domainfields_" + ewmon_controller.currentUsername + "_" + ewmon_controller.currentPassword + "_"+domainName+".xml",
datatype:"xml"
}
return data;
}
the $$(‘prueba’).reconstruct() generate an error with error stack:
Uncaught TypeError: Cannot read property '1' of undefined touchui_debug.js:4709
dhx.protoUI._set_child_size touchui_debug.js:4709
dhx.protoUI.$setSize touchui_debug.js:4704
dhx.protoUI.$setSize touchui_debug.js:6936
dhx.protoUI._set_child_size touchui_debug.js:4739
dhx.protoUI._set_child_size touchui_debug.js:4827
dhx.protoUI.$setSize touchui_debug.js:4814
dhx.protoUI.reconstruct touchui_debug.js:4568
data.view EWmonGridErrorController.js:176
x.onreadystatechange touchui_debug.js:2617
even if the data are generated correctly in fact when I resize the window I can see the components well created.
can you please tell me why I get this error, for what I see is due to size specification of the layout but I cannot find the way to solve it.
Thanks in advance for your help
Danilo