Fixed the following jslint warnings:
Lint at line 5 character 16: 'WebGUI' was used before it was defined.
var WebGUI = {};
Lint at line 53 character 86: Missing '()' invoking a constructor.
data[ columns[ i ].key ] = columns[i].formatter == "date" ? new Date : "";
Lint at line 89 character 21: 'i' is already defined.
for ( var i = 0; i < cols.length; i++ ) {
Lint at line 612 character 25: 'col' is already defined.
var col = this.dataTable.getColumn( oldKey );
Lint at line 661 character 63: Missing '()' invoking a constructor.
allRecords[j].setData(newKey, new Date);
This commit is contained in:
parent
8e7beabaf0
commit
5ea09092ad
1 changed files with 5 additions and 4 deletions
|
|
@ -1,4 +1,5 @@
|
||||||
|
|
||||||
|
/*global WebGUI*/
|
||||||
// Initialize namespace
|
// Initialize namespace
|
||||||
if (typeof WebGUI == "undefined") {
|
if (typeof WebGUI == "undefined") {
|
||||||
var WebGUI = {};
|
var WebGUI = {};
|
||||||
|
|
@ -49,7 +50,7 @@ WebGUI.Form.DataTable
|
||||||
data = {};
|
data = {};
|
||||||
var columns = this.dataTable.getColumnSet().getDefinitions();
|
var columns = this.dataTable.getColumnSet().getDefinitions();
|
||||||
for ( var i = 0; i < columns.length; i++ ) {
|
for ( var i = 0; i < columns.length; i++ ) {
|
||||||
data[ columns[ i ].key ] = columns[i].formatter == "date" ? new Date : "";
|
data[ columns[ i ].key ] = columns[i].formatter == "date" ? new Date() : "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.dataTable.addRow( data );
|
this.dataTable.addRow( data );
|
||||||
|
|
@ -85,7 +86,7 @@ WebGUI.Form.DataTable
|
||||||
|
|
||||||
// Get the columns
|
// Get the columns
|
||||||
var cols = this.dataTable.getColumnSet().getDefinitions();
|
var cols = this.dataTable.getColumnSet().getDefinitions();
|
||||||
for ( var i = 0; i < cols.length; i++ ) {
|
for ( i = 0; i < cols.length; i++ ) {
|
||||||
data.columns[ i ] = cols[i];
|
data.columns[ i ] = cols[i];
|
||||||
delete data.columns[ i ].editor;
|
delete data.columns[ i ].editor;
|
||||||
delete data.columns[ i ].editorOptions;
|
delete data.columns[ i ].editorOptions;
|
||||||
|
|
@ -608,7 +609,7 @@ WebGUI.Form.DataTable
|
||||||
var oldKey = data[ "oldKey_" + i ];
|
var oldKey = data[ "oldKey_" + i ];
|
||||||
var newKey = data[ "newKey_" + i ];
|
var newKey = data[ "newKey_" + i ];
|
||||||
var format = data[ "format_" + i ][0];
|
var format = data[ "format_" + i ][0];
|
||||||
var col = this.dataTable.getColumn( oldKey );
|
col = this.dataTable.getColumn( oldKey );
|
||||||
|
|
||||||
// Don't allow adding multiple columns with same key
|
// Don't allow adding multiple columns with same key
|
||||||
if ( oldKey != newKey && this.dataTable.getColumn( newKey ) ) {
|
if ( oldKey != newKey && this.dataTable.getColumn( newKey ) ) {
|
||||||
|
|
@ -657,7 +658,7 @@ WebGUI.Form.DataTable
|
||||||
var numRecords = allRecords.length;
|
var numRecords = allRecords.length;
|
||||||
for (j=0; j < numRecords; j++) {
|
for (j=0; j < numRecords; j++) {
|
||||||
if (format == "date") {
|
if (format == "date") {
|
||||||
allRecords[j].setData(newKey, new Date);
|
allRecords[j].setData(newKey, new Date());
|
||||||
} else {
|
} else {
|
||||||
allRecords[j].setData(newKey, '');
|
allRecords[j].setData(newKey, '');
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue