Attempting to execute a .getState on the parent of a portlet to save the position of all the sub components. This does not appear to work, what is the process of saving state on a portlet?
type: "space",
rows:[{
type:"space",
id:"main",
rows:[
{ view:"portlet", header: "First row", body:{
template:" "
}},
{ view:"portlet", header: "Second row", body:{
template:" "
}},
{ type:"wide", cols:[
{ view:"portlet", header: "First column", body:{
template:" "
}},
{ view:"portlet", header: "Second column", body:{
template:" ",
}}
]
}
]
},{
template: '<input type="button" name="save_state" value="Save state" onclick="save_state()" /> <input type="button" name="restore_state" value="Restore state" onclick="restore_state()" />',
}
]
function save_state() {
webix.storage.local.put("stateApp", webix.UIManager.getState("main", true));
}
function restore_state() {
var stateApp = webix.storage.local.get("stateApp");
if(stateApp)
webix.UIManager.setState(stateApp);
}