diff -r 4328bcbd748e -r 7c184924d492 web/views/treeview.py --- a/web/views/treeview.py Mon Feb 23 11:30:38 2009 +0100 +++ b/web/views/treeview.py Mon Feb 23 12:12:59 2009 +0100 @@ -1,32 +1,38 @@ from logilab.mtconverter import html_escape + from cubicweb.interfaces import ITree from cubicweb.common.selectors import implement_interface, yes from cubicweb.common.view import EntityView +from cubicweb.web.views.baseviews import OneLineView + class TreeView(EntityView): id = 'treeview' accepts = ('Any',) itemvid = 'treeitemview' css_classes = 'treeview widget' title = _('tree view') - - def call(self, subvid=None, treeid=None): + + def call(self, subvid=None): if subvid is None and 'subvid' in self.req.form: subvid = self.req.form.pop('subvid') # consume it if subvid is None: subvid = 'oneline' self.req.add_css('jquery.treeview.css') - self.req.add_js(('cubicweb.ajax.js', 'jquery.treeview.js')) - # XXX find a way, an id is MANDATORY - treeid = 'TREE' #treeid or self.rset.rows[0][0] - self.req.html_headers.add_onload(u""" - $("#tree-%s").treeview({toggle: toggleTree, - prerendered: true});""" % treeid) - self.w(u'