|
|
@ -33,8 +33,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
var dynamicTable = new Class({ |
|
|
|
var dynamicTable = new Class({ |
|
|
|
|
|
|
|
|
|
|
|
initialize: function(){ |
|
|
|
initialize : function () {}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setup : function (table, progressIndex, context_menu) { |
|
|
|
setup : function (table, progressIndex, context_menu) { |
|
|
|
this.table = $(table); |
|
|
|
this.table = $(table); |
|
|
@ -100,8 +99,7 @@ var dynamicTable = new Class ({ |
|
|
|
return ''; |
|
|
|
return ''; |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
altRow: function() |
|
|
|
altRow : function () { |
|
|
|
{ |
|
|
|
|
|
|
|
var trs = this.table.getElements('tr'); |
|
|
|
var trs = this.table.getElements('tr'); |
|
|
|
trs.each(function (el, i) { |
|
|
|
trs.each(function (el, i) { |
|
|
|
if (i % 2) { |
|
|
|
if (i % 2) { |
|
|
@ -113,7 +111,8 @@ var dynamicTable = new Class ({ |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
hidePriority : function () { |
|
|
|
hidePriority : function () { |
|
|
|
if(this.priority_hidden) return; |
|
|
|
if (this.priority_hidden) |
|
|
|
|
|
|
|
return; |
|
|
|
$('prioHeader').addClass('invisible'); |
|
|
|
$('prioHeader').addClass('invisible'); |
|
|
|
var trs = this.table.getElements('tr'); |
|
|
|
var trs = this.table.getElements('tr'); |
|
|
|
trs.each(function (tr, i) { |
|
|
|
trs.each(function (tr, i) { |
|
|
@ -128,7 +127,8 @@ var dynamicTable = new Class ({ |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
showPriority : function () { |
|
|
|
showPriority : function () { |
|
|
|
if(!this.priority_hidden) return; |
|
|
|
if (!this.priority_hidden) |
|
|
|
|
|
|
|
return; |
|
|
|
$('prioHeader').removeClass('invisible'); |
|
|
|
$('prioHeader').removeClass('invisible'); |
|
|
|
var trs = this.table.getElements('tr'); |
|
|
|
var trs = this.table.getElements('tr'); |
|
|
|
trs.each(function (tr, i) { |
|
|
|
trs.each(function (tr, i) { |
|
|
@ -188,16 +188,21 @@ var dynamicTable = new Class ({ |
|
|
|
var tr = new Element('tr'); |
|
|
|
var tr = new Element('tr'); |
|
|
|
tr.addClass("menu-target"); |
|
|
|
tr.addClass("menu-target"); |
|
|
|
this.rows.set(id, tr); |
|
|
|
this.rows.set(id, tr); |
|
|
|
for(var i=0; i<row.length; i++) |
|
|
|
for (var i = 0; i < row.length; i++) { |
|
|
|
{ |
|
|
|
|
|
|
|
var td = new Element('td'); |
|
|
|
var td = new Element('td'); |
|
|
|
if (i == this.progressIndex) { |
|
|
|
if (i == this.progressIndex) { |
|
|
|
td.adopt(new ProgressBar(row[i].toFloat(), {'id': 'pb_'+id, 'width':80})); |
|
|
|
td.adopt(new ProgressBar(row[i].toFloat(), { |
|
|
|
|
|
|
|
'id' : 'pb_' + id, |
|
|
|
|
|
|
|
'width' : 80 |
|
|
|
|
|
|
|
})); |
|
|
|
if (typeof data[i] != 'undefined') |
|
|
|
if (typeof data[i] != 'undefined') |
|
|
|
td.set('data-raw', data[i]) |
|
|
|
td.set('data-raw', data[i]) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
if (i == 0) { |
|
|
|
if (i == 0) { |
|
|
|
td.adopt(new Element('img', {'src':row[i], 'class': 'statusIcon'})); |
|
|
|
td.adopt(new Element('img', { |
|
|
|
|
|
|
|
'src' : row[i], |
|
|
|
|
|
|
|
'class' : 'statusIcon' |
|
|
|
|
|
|
|
})); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
if (i == 2) { |
|
|
|
if (i == 2) { |
|
|
|
// Priority
|
|
|
|
// Priority
|
|
|
@ -335,7 +340,8 @@ var dynamicTable = new Class ({ |
|
|
|
if (this.applyFilterOnRow(tr, status)) { |
|
|
|
if (this.applyFilterOnRow(tr, status)) { |
|
|
|
var tds = tr.getElements('td'); |
|
|
|
var tds = tr.getElements('td'); |
|
|
|
for (var i = 0; i < row.length; i++) { |
|
|
|
for (var i = 0; i < row.length; i++) { |
|
|
|
if(i==1) continue; // Do not refresh name
|
|
|
|
if (i == 1) |
|
|
|
|
|
|
|
continue; // Do not refresh name
|
|
|
|
if (i == this.progressIndex) { |
|
|
|
if (i == this.progressIndex) { |
|
|
|
$('pb_' + id).setValue(row[i]); |
|
|
|
$('pb_' + id).setValue(row[i]); |
|
|
|
} else { |
|
|
|
} else { |
|
|
@ -362,8 +368,7 @@ var dynamicTable = new Class ({ |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
removeRow : function (id) { |
|
|
|
removeRow : function (id) { |
|
|
|
if(this.cur.contains(id)) |
|
|
|
if (this.cur.contains(id)) { |
|
|
|
{ |
|
|
|
|
|
|
|
this.cur.erase(id); |
|
|
|
this.cur.erase(id); |
|
|
|
} |
|
|
|
} |
|
|
|
if (this.rows.has(id)) { |
|
|
|
if (this.rows.has(id)) { |
|
|
|