From cbba19da672a74c6e3edd7dc577e09e5f07f3bb9 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Thu, 28 Jun 2012 10:45:47 +0200 Subject: [PATCH] [IMP] automatically focus first field of edited row bzr revid: xmo@openerp.com-20120628084547-6fo7fkiy2gh2wb6m --- addons/web/static/src/js/view_list_editable.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/web/static/src/js/view_list_editable.js b/addons/web/static/src/js/view_list_editable.js index 4109a5bd6d5..74b51c3c686 100644 --- a/addons/web/static/src/js/view_list_editable.js +++ b/addons/web/static/src/js/view_list_editable.js @@ -147,7 +147,6 @@ openerp.web.list_editable = function (instance) { return this.form.on_record_loaded(record.attributes).pipe(function () { return self.form.do_show({reload: false}); }).then(function () { - // TODO: automatic focus of ?first field // TODO: [Save] button // TODO: save on action button? _(cells).each(function (cell, field_name) { @@ -169,6 +168,8 @@ openerp.web.list_editable = function (instance) { minHeight: $cell.outerHeight() }); }); + // TODO: actually focus clicked field (if editable) + self.form.fields[self.form.fields_order[0]].focus(); self.trigger('edit:after', record, self.form) });