~openerp-dev/openerp-web/trunk-customfilter-jir

« back to all changes in this revision

Viewing changes to addons/web/static/src/js/view_tree.js

  • Committer: Vidhin Mehta
  • Date: 2013-10-29 13:30:14 UTC
  • mfrom: (3747.2.121 trunk)
  • Revision ID: vme@tinyerp.com-20131029133014-dh9mutz0d2hl0k7z
[MERGE]latest

Show diffs side-by-side

added added

removed removed

Lines of Context:
166
166
            var is_loaded = 0,
167
167
                $this = $(this),
168
168
                record_id = $this.data('id'),
169
 
                parent_id = $this.data('parent-id'),
 
169
                row_parent_id = $this.data('row-parent-id'),
170
170
                record = self.records[record_id],
171
171
                children_ids = record[self.children_field];
172
172
 
173
173
            _(children_ids).each(function(childid) {
174
 
                if (self.$el.find('[id=treerow_' + childid + '][data-parent-id='+ record_id +']').length ) {
175
 
                    if (self.$el.find('[id=treerow_' + childid + '][data-parent-id='+ record_id +']').is(':hidden')) {
 
174
                if (self.$el.find('[id=treerow_' + childid + '][data-row-parent-id='+ record_id +']').length ) {
 
175
                    if (self.$el.find('[id=treerow_' + childid + '][data-row-parent-id='+ record_id +']').is(':hidden')) {
176
176
                        is_loaded = -1;
177
177
                    } else {
178
178
                        is_loaded++;
196
196
            _(records).each(function (record) {
197
197
                self.records[record.id] = record;
198
198
            });
199
 
 
200
199
            var $curr_node = self.$el.find('#treerow_' + id);
201
200
            var children_rows = QWeb.render('TreeView.rows', {
202
201
                'records': records,
206
205
                'level': $curr_node.data('level') || 0,
207
206
                'render': instance.web.format_value,
208
207
                'color_for': self.color_for,
209
 
                'parent_id': id
 
208
                'row_parent_id': id
210
209
            });
211
210
            if ($curr_node.length) {
212
211
                $curr_node.addClass('oe_open');
250
249
    showcontent: function (curnode,record_id, show) {
251
250
        curnode.parent('tr').toggleClass('oe_open', show);
252
251
        _(this.records[record_id][this.children_field]).each(function (child_id) {
253
 
            var $child_row = this.$el.find('[id=treerow_' + child_id + '][data-parent-id='+ curnode.data('id') +']');
 
252
            var $child_row = this.$el.find('[id=treerow_' + child_id + '][data-row-parent-id='+ curnode.data('id') +']');
254
253
            if ($child_row.hasClass('oe_open')) {
255
254
                $child_row.toggleClass('oe_open',show);
256
255
                this.showcontent($child_row, child_id, false);