Skip to content

Commit

Permalink
Move renderUI to @Protected section
Browse files Browse the repository at this point in the history
  • Loading branch information
lsmith committed Dec 22, 2011
1 parent ca15223 commit 592e4ce
Showing 1 changed file with 33 additions and 32 deletions.
65 changes: 33 additions & 32 deletions src/datatable/js/core.js
Expand Up @@ -357,38 +357,6 @@ Y.mix(Table.prototype, {
return this.body && this.body.getCell && this.body.getRow(index);
},

/**
Builds the table and attaches it to the DOM. This requires the host class
to provide a `contentBox` attribute. This is typically provided by Widget.
@method renderUI
**/
renderUI: function () {
var contentBox = this.get('contentBox'),
table;

if (contentBox) {
this._renderTable();

this._renderHeader();

this._renderFooter();

this._renderBody();

table = this._tableNode;

if (table) {
// off DOM or in an existing node attached to a different parentNode
if (!table.inDoc() || !table.ancestor().compareTo(contentBox)) {
contentBox.append(table);
}
} else { Y.log('Problem rendering DataTable: table not created', 'warn', 'datatable'); // On the same line to allow builder to strip the else clause
}
} else { Y.log('Problem rendering DataTable: contentBox not found', 'warn', 'datatable'); // On the same line to allow builder to strip the else clause
}
},

// -- Protected and private properties and methods ------------------------

/**
Expand Down Expand Up @@ -930,6 +898,39 @@ Y.mix(Table.prototype, {
this._uiUpdateCaption(caption);
},

/**
Builds the table and attaches it to the DOM. This requires the host class
to provide a `contentBox` attribute. This is typically provided by Widget.
@method renderUI
@protected
**/
renderUI: function () {
var contentBox = this.get('contentBox'),
table;

if (contentBox) {
this._renderTable();

this._renderHeader();

this._renderFooter();

this._renderBody();

table = this._tableNode;

if (table) {
// off DOM or in an existing node attached to a different parentNode
if (!table.inDoc() || !table.ancestor().compareTo(contentBox)) {
contentBox.append(table);
}
} else { Y.log('Problem rendering DataTable: table not created', 'warn', 'datatable'); // On the same line to allow builder to strip the else clause
}
} else { Y.log('Problem rendering DataTable: contentBox not found', 'warn', 'datatable'); // On the same line to allow builder to strip the else clause
}
},

/**
Assigns the `\_columnMap` property with the parsed results of the array of
column definitions passed.
Expand Down

0 comments on commit 592e4ce

Please sign in to comment.