Fixed list generator to display the desc icon when list key has desc attribute. See jobs tab for example. When first loaded, the jobs list is sorted by job id in desc order, so the desc sort icon now displays in the job id column header.

This commit is contained in:
chouseknecht 2013-06-12 11:52:10 -04:00
parent e1d714a335
commit 4ac2a98eda
2 changed files with 34 additions and 3 deletions

View File

@ -722,7 +722,17 @@ angular.module('FormGenerator', ['GeneratorHelpers'])
"ng-click=\"sort('" + form.related[itm].iterator + "', '" + fld + "')\">" +
form.related[itm]['fields'][fld].label;
html += " <i class=\"";
html += (form.related[itm].fields[fld].key) ? "icon-sort-up" : "icon-sort";
if (form.related[itm].fields[fld].key) {
if (form.related[itm].fields[fld].desc) {
html += "icon-sort-down";
}
else {
html += "icon-sort-up";
}
}
else {
html += "icon-sort";
}
html += "\"></i></a></th>\n";
}
html += "<th></th>\n";
@ -881,7 +891,18 @@ angular.module('FormGenerator', ['GeneratorHelpers'])
"ng-click=\"sort('" + form.related[itm].iterator + "', '" + fld + "')\">" +
form.related[itm]['fields'][fld].label;
html += " <i class=\"";
html += (form.related[itm].fields[fld].key) ? "icon-sort-up" : "icon-sort";
//html += (form.related[itm].fields[fld].key) ? "icon-sort-up" : "icon-sort";
if (form.related[itm].fields[fld].key) {
if (form.related[itm].fields[fld].desc) {
html += "icon-sort-down";
}
else {
html += "icon-sort-up";
}
}
else {
html += "icon-sort";
}
html += "\"></i></a></th>\n";
}
html += "<th></th>\n";

View File

@ -184,7 +184,17 @@ angular.module('ListGenerator', ['GeneratorHelpers'])
for (var fld in list.fields) {
html += "<th class=\"list-header\" id=\"" + fld + "-header\" ng-click=\"sort('" + fld + "')\">" + list.fields[fld].label;
html += " <i class=\"";
html += (list.fields[fld].key) ? "icon-sort-up" : "icon-sort";
if (list.fields[fld].key) {
if (list.fields[fld].desc) {
html += "icon-sort-down";
}
else {
html += "icon-sort-up";
}
}
else {
html += "icon-sort";
}
html += "\"></i></a></th>\n";
}
if (options.mode == 'select') {