shows the specified view, creates a new one if it doesn't exist
name | string | view name |
boolean | true if view was accessed first time, false otherwise |
// here is an example how to initialize content
// in several views on demand inside of a cell
// 1) for the default view "def" we will simply attach an URL
// 2) for the "grid" view we will attach menu and grid
// 3) and for the "tree" view we will attach toolbar and tree
var myMenu;
var myGrid;
var myToolbar;
var myTree;
// the default view is ready right after component initialization
dhxComponent.cells(id).attachURL("http://somedomain.com/page.html");
function initView(name) {
// assuming that this function will be called after some user action
// like a button click or some other
var state = dhxComponent.cells(id).showView(name);
if (state == true) {
// first call, initializes corresponding components
if (name == "grid") {
myMenu = dhxComponent.cells(id).attachMenu();
myGrid = dhxComponent.cells(id).attachGrid();
} else if (name == "tree") {
myToolbar = dhxComponent.cells(id).attachToolbar();
myTree = dhxComponent.cells(id).attachTree();
}
}
}
The default view name is "def", it is created automatically when a cell is created
Back to top