added support for bolding/highlighting a given column of data (e.g. error messages)
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 2 Oct 2006 14:14:07 +0000 (14:14 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 2 Oct 2006 14:14:07 +0000 (14:14 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@6350 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/opac/common/js/fm_table.js
Open-ILS/web/opac/common/js/fm_table_conf.js

index 1772c9c..5bfa913 100644 (file)
@@ -110,12 +110,17 @@ FMObjectBuilder.prototype.selectNone = function() {
 /* */
 FMObjectBuilder.prototype.setKeys = function(o) {
        var sortme = false;
-       if( this.display[o.classname] ) 
+       if( this.display[o.classname] ) {
                this.keys = this.display[o.classname].fields;
+               this.bold = this.display[o.classname].bold;
+       }
 
        if(!this.keys && FM_TABLE_DISPLAY[o.classname])
                this.keys = FM_TABLE_DISPLAY[o.classname].fields;
 
+       if(!this.bold && FM_TABLE_DISPLAY[o.classname])
+               this.bold = FM_TABLE_DISPLAY[o.classname].bold;
+
        if(!this.keys) {
                this.keys = fmclasses[o.classname];
                sortme = true;
@@ -206,7 +211,12 @@ FMObjectBuilder.prototype.fleshData = function(td, data, key) {
                }
 
        } else {
-               td.appendChild(text( data ));
+               if( this.bold && grep(this.bold,function(i){return (i==key)}) ) {
+                       var span = elem('span',{'class':'fm_table_bold'}, data);
+                       td.appendChild(span);
+               } else {
+                       td.appendChild(text( data ));
+               }
        }
 }
 
index 250ce2b..e3f728f 100644 (file)
@@ -109,6 +109,9 @@ var FM_TABLE_DISPLAY = {
                        'excel_format',
                        'html_format',
                        'csv_format',
+               ],
+               bold : [
+                       'error_text',
                ]
        }
 }