From 41d6296789bf845d969a39d65f598628e95d64cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 23 Aug 2013 14:12:39 +0200 Subject: [PATCH] Implement many and tree view in Window.Form --- src/window.js | 151 +++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 143 insertions(+), 8 deletions(-) diff --git a/src/window.js b/src/window.js index 505305e34a..5e8c71fc23 100644 --- a/src/window.js +++ b/src/window.js @@ -37,10 +37,6 @@ this.callback = callback; this.el = jQuery('
'); - if (view_type == 'tree') { - // TODO - } - var buttons = []; buttons.push({ text: (!kwargs.new_ && this.screen.current_view && @@ -51,6 +47,15 @@ }.bind(this) }); + if (kwargs.new_ && this.many) { + buttons.push({ + text: 'New', + click: function() { + this.response('RESPONSE_ACCEPT'); + }.bind(this) + }); + } + if (this.save_current) { buttons.push({ text: 'Save', @@ -67,24 +72,144 @@ }); } + var menu; + if (view_type == 'tree') { + menu = jQuery('
'); + var access = Sao.common.MODELACCESS.get(this.screen.model_name); + if (this.domain) { + this.wid_text = jQuery('', { + type: 'input' + }); + menu.append(this.wid_text); + + this.but_add = jQuery('