Document layout
Retrieve document layout
- Object: getARenderJS().getDocumentLayout()
Function | Description | Arguments |
---|---|---|
getDocumentLayout(documentId, handler, errorHandler) | Retrieve a flattened document layout | documentId: the document id handler: the callback function to call when the layout is resolved errorHandler: the callback function to call when an error occurs |
getShallowDocumentLayout(documentId, handler, errorHandler) | Retrieve a document layout. If the layout is a container then the children have only the document id as information. | documentId: the document id handler: the callback function to call when the layout is resolved errorHandler: the callback function to call when an error occurs |
// Retrieve a document layout
getARenderJS().getDocumentLayout().getShallowDocumentLayout(getARenderJS().getMasterDocumentId(), function(layout) {
// Check if layout is a document container
if (layout.isDocumentContainer()) {
var children = layout.getChildren();
for (var i=0; i<children.length; i++)
{
var child = children[i];
// Print child document ID
console.info("child id = " + child.getDocumentId());
}
}
});