[IMP] kanban :- add basic struncture of folding and unfolding columns.

bzr revid: ysa@tinyerp.com-20110916130049-ppachcw4xne1rzjw
This commit is contained in:
Yogesh (OpenERP) 2011-09-16 18:30:49 +05:30
parent 681a5bd001
commit 903ae74c11
3 changed files with 41 additions and 19 deletions

View File

@ -2,18 +2,25 @@
float: left;
width: 100%;
}
.openerp .oe_kanban_view .ui-sortable-placeholder {
border: 1px dotted black;
visibility: visible !important;
height: 60px !important;
}
.oe_kanban_row {
overflow:hidden;
}
.oe_table_column {
float:left;
}
.openerp .oe_kanban_view .oe_column_heading {
color: #000000;
font-size: 1.5em;
font-weight: bold;
}
.openerp .oe_kanban_view {
overflow:hidden;
}
.openerp .oe_kanban_action_button {
height: 22px;
margin: 0;

View File

@ -19,6 +19,7 @@ openerp.web_kanban.KanbanView = openerp.web.View.extend({
this.groups = [];
this.qweb = new QWeb2.Engine();
this.NO_OF_COLUMNS = 2;
this.DISPLAY_COLUMNS = 3;
if (this.options.action_views_ids.form) {
this.form_dialog = new openerp.web.FormDialog(this, {}, this.options.action_views_ids.form, dataset).start();
this.form_dialog.on_form_dialog_saved.add_last(this.on_record_saved);
@ -151,6 +152,18 @@ openerp.web_kanban.KanbanView = openerp.web.View.extend({
});
this.$element.find(".oe_column").disableSelection()
this.$element.find('button.oe_kanban_button_new').click(this.do_add_record);
var column_width = 100 / (this.all_display_data).length;
var row_width = column_width * (this.all_display_data).length * this.DISPLAY_COLUMNS;
self.$element.find(".oe_table_column" ).css("width", column_width +"%");
self.$element.find(".oe_kanban_row" ).css("width", row_width +"%");
this.$element.find('#next-column').click(function(event) {
event.preventDefault();
self.$element.find('.oe_kanban_view').animate({"scrollLeft" : "+=" + self.$element.find('.oe_column').width()}, 'slow');
});
this.$element.find('#previous-column').click(function(event) {
event.preventDefault();
self.$element.find('.oe_kanban_view').animate({scrollLeft:'-=' + self.$element.find('.oe_column').width() }, 'slow');
});
},
do_record_group: function() {
if (this.NO_OF_COLUMNS) {

View File

@ -1,26 +1,28 @@
<template>
<t t-name="KanbanView">
<table style="width:100%;" class="oe_kanban_view">
<tr>
<td>
<div>
<div>
<div class="oe_form_header">
<button type="button" class="oe_kanban_button_new">New</button>
<a id="previous-column" href="#">Previous</a>
<a id="next-column" href="#">Next</a>
</div>
</td>
</tr>
<tr>
<td t-foreach="data" t-as="columns" class="oe_table_column oe_column_heading" t-att-id="'column_' + columns.value">
<t t-if="columns.value" t-esc="columns.header"/>
</td>
</tr>
<tr>
<td t-foreach="data" t-as="columns" class="oe_table_column" t-att-id="'column_' + columns.value" t-attf-style="width: #{Math.round(99 / data.length)}%">
<div class="oe_column" t-att-id="'column_' + columns.value">
<div t-foreach="columns.records" t-as="record" class="oe_kanban_record" t-att-id="'main_' + record.id"/>
</div>
</div>
<div style="width:100%;" class="oe_kanban_view">
<div class="oe_kanban_row">
<div t-foreach="data" t-as="columns" class="oe_table_column oe_column_heading" t-att-id="'column_' + columns.value">
<t t-if="columns.value" t-esc="columns.header"/>
</div>
</td>
</tr>
</table>
</div>
<div class="oe_kanban_row">
<div t-foreach="data" t-as="columns" class="oe_table_column" t-att-id="'column_' + columns.value">
<div class="oe_column" t-att-id="'column_' + columns.value">
<div t-foreach="columns.records" t-as="record" class="oe_kanban_record" t-att-id="'main_' + record.id"/>
</div>
</div>
</div>
</div>
</t>
<t t-name="KanbanColorPicker">
<table cellspacing="0" cellpadding="0" border="0" class="oe_kanban_color_picker">