[ADD] global select/unselect toggle on lists
bzr revid: xmo@openerp.com-20111025105925-7ghxlljq6ugupxx5
This commit is contained in:
commit
e35686ca93
|
@ -201,8 +201,15 @@ openerp.web.ListView = openerp.web.View.extend( /** @lends openerp.web.ListView#
|
||||||
this.setup_columns(this.fields_view.fields, grouped);
|
this.setup_columns(this.fields_view.fields, grouped);
|
||||||
|
|
||||||
this.$element.html(QWeb.render("ListView", this));
|
this.$element.html(QWeb.render("ListView", this));
|
||||||
|
|
||||||
// Head hook
|
// Head hook
|
||||||
|
this.$element.find('.all-record-selector').click(function(){
|
||||||
|
self.$element.find('.oe-record-selector input').prop('checked',
|
||||||
|
self.$element.find('.all-record-selector').prop('checked') || false);
|
||||||
|
var selection = self.groups.get_selection();
|
||||||
|
$(self.groups).trigger(
|
||||||
|
'selected', [selection.ids, selection.records]);
|
||||||
|
});
|
||||||
|
|
||||||
this.$element.find('.oe-list-add')
|
this.$element.find('.oe-list-add')
|
||||||
.click(this.do_add_record)
|
.click(this.do_add_record)
|
||||||
.attr('disabled', grouped && this.options.editable);
|
.attr('disabled', grouped && this.options.editable);
|
||||||
|
|
|
@ -579,7 +579,8 @@
|
||||||
<t t-esc="column.string"/>
|
<t t-esc="column.string"/>
|
||||||
</th>
|
</th>
|
||||||
</t>
|
</t>
|
||||||
<th t-if="options.selectable" width="1"/>
|
<th t-if="options.selectable" width="1" >
|
||||||
|
<input type="checkbox" class="all-record-selector"/> </th>
|
||||||
<t t-foreach="columns" t-as="column">
|
<t t-foreach="columns" t-as="column">
|
||||||
<th t-if="!column.meta and column.invisible !== '1'" t-att-data-id="column.id"
|
<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)">
|
t-att-class="((options.sortable and column.tag !== 'button') ? 'oe-sortable' : null)">
|
||||||
|
|
Loading…
Reference in New Issue