[FIX] Fixed the issue of checkbutton select all/none in tree view.

lp bug: https://launchpad.net/bugs/878108 fixed

bzr revid: kbh@bde-desktop-20111024091730-dkzafro2f9e0k7tf
This commit is contained in:
kbh 2011-10-24 14:47:30 +05:30
parent 28a5550cf6
commit 2ce07c97c6
2 changed files with 9 additions and 2 deletions

View File

@ -201,8 +201,8 @@ openerp.web.ListView = openerp.web.View.extend( /** @lends openerp.web.ListView#
this.setup_columns(this.fields_view.fields, grouped);
this.$element.html(QWeb.render("ListView", this));
// Head hook
this.$element.find('#all_checked').click(this.do_all_checked);
this.$element.find('.oe-list-add')
.click(this.do_add_record)
.attr('disabled', grouped && this.options.editable);
@ -269,6 +269,11 @@ openerp.web.ListView = openerp.web.View.extend( /** @lends openerp.web.ListView#
this.set_common_sidebar_sections(this.sidebar);
}
},
do_all_checked:function (ev) {
var all_checkbox = this.$element.find('.oe-record-selector :checkbox')
all_checkbox.attr('checked', !all_checkbox.attr('checked'));
},
/**
* Configures the ListView pager based on the provided dataset's information
*
@ -650,6 +655,7 @@ openerp.web.ListView = openerp.web.View.extend( /** @lends openerp.web.ListView#
$first_header.attr('colspan', parseInt(colspan, 10) + count);
}
// Padding for column titles, footer and data rows
var $rows = this.$element
.find('.oe-listview-header-columns, tr:not(thead tr)')
.not(options['except']);

View File

@ -593,7 +593,8 @@
<t t-esc="column.string"/>
</th>
</t>
<th t-if="options.selectable" width="1"/>
<th t-if="options.selectable" width="1" >
<input type="checkbox" id ="all_checked"/> </th>
<t t-foreach="columns" t-as="column">
<th t-if="!column.meta and column.invisible !== '1'" t-att-data-id="column.id"
t-att-class="((options.sortable and column.tag !== 'button') ? 'oe-sortable' : null)">