Skip to content

Instantly share code, notes, and snippets.

Created February 17, 2012 10:55
Show Gist options
  • Save anonymous/1852652 to your computer and use it in GitHub Desktop.
Save anonymous/1852652 to your computer and use it in GitHub Desktop.
T3.Content.UI.PageTreeButton = T3.Content.UI.PopoverButton.extend({
popoverTitle: 'Page Tree',
$popoverContent: $('<div class="extjs-container"><div class="t3-dd-newpage">New page</div><div id="pagetree"></div><div class="t3-dd-deletionzone" id="ext-gen68">Drop here to delete</div></div>'),
_tree: null,
onPopoverOpen: function() {
if (this._tree) return;
this.tree = $("#pagetree").dynatree({
/**
* Wrapper for extDirect call to NodeController which
* adds the child node type to the extDirect call as 2nd parameter.
*
* @param {String} contextNodePath the current Context Node Path to get subnodes from
* @param {Function} callback function after request is done
* @return {void}
*/
onPostInit: function(contextNodePath, callback) {
TYPO3_TYPO3_Service_ExtDirect_V1_Controller_NodeController.getChildNodesForTree('/sites/phoenixdemotypo3org@user-admin', 'TYPO3.TYPO3:Page', callback);
//TYPO3_TYPO3_Service_ExtDirect_V1_Controller_NodeController.getChildNodesForTree(contextNodePath, 'TYPO3.TYPO3:Page', callback);
},
onRender: function(result, response, args) {
if (response.status) {
this.handleResponse({
responseData: Ext.isArray(result.data) ? result.data : null,
responseText: result,
argument: args
});
} else {
this.handleFailure({
argument: args
});
}
}
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment