easy_install tw.extjs
Widget definition:
from tw.extjs import TreeView
extTree = TreeView(divID='treeView1', fetch='fetchTree')
@expose('myproject.templates.tableview')
def ext(self):
pylons.c.tree = extTree
return dict()
${tmpl_context.tree()}
import simplejson
def _getData(self, node):
#return a list of dictionaries
#dictionaries have the format:
# {'text':visible_node_name, 'id':identifier, 'cls':'file'|'folder', 'allowChildren':False, 'leaf':True}
#return the data for a given node
#more here soon
pass
@expose()
def fetchTree(self, node):
r = [self._getData(node),]
return simplejson.dumps(r)
Todo
Difficulty: Medium. This entire tutorial is code snippets. Add some text to explain what is going on