Use columnNgClass instead of ngClass for columns

ngClass gets placed on both the td and the link (if an ngClick is
    provided); this is not good, therefore splitting them out into
ngClass for the link class (for backwards compatibility) and
columnNgClass for the class on the td.
This commit is contained in:
Joe Fiorini 2015-03-10 10:03:25 -04:00
parent a4b4c92a31
commit 0dc04cd057
2 changed files with 7 additions and 1 deletions

View File

@ -330,6 +330,7 @@ angular.module('GeneratorHelpers', [])
html = "<td class=\"" + fld + "-column";
html += (field.columnClass) ? " " + field.columnClass : "";
html += (field.columnNgClass) ? "\" ng-class=\"" + field.columnNgClass : "";
html += "\">\n";
html += "<a ng-href=\"" + field.ngHref + "\" aw-tool-tip=\"" + field.awToolTip + "\"";
html += (field.dataPlacement) ? " data-placement=\"" + field.dataPlacement + "\"" : "";
@ -576,7 +577,7 @@ angular.module('GeneratorHelpers', [])
html += " " + field.columnClass;
}
html += "\" ";
html += (field.ngClass) ? Attr(field, 'ngClass') : "";
html += field.columnNgClass ? " ng-class=\"" + field.columnNgClass + "\"": "";
html += (options.mode === 'lookup' || options.mode === 'select') ? " ng-click=\"toggle_" + list.iterator +
"(" + list.iterator + ".id)\"" : "";
html += (field.columnShow) ? Attr(field, 'columnShow') : "";

View File

@ -547,6 +547,11 @@ angular.module('ListGenerator', ['GeneratorHelpers'])
else if (list.fields[fld].columnClass) {
html += " " + list.fields[fld].columnClass;
}
if (list.fields[fld].columnNgClass) {
html += "\" ng-class=\"" + list.fields[fld].columnNgClass
}
html += "\" id=\"" + list.iterator + "-" + fld + "-header\"";
html += (list.fields[fld].columnShow) ? " ng-show=\"" + list.fields[fld].columnShow + "\" " : "";
html += (list.fields[fld].nosort === undefined || list.fields[fld].nosort !== true) ? " ng-click=\"sort('" + list.iterator + "','" + fld + "')\"" : "";