Browse Source

Add column level string escaping

Jack Jamieson 9 years ago
parent
commit
448ebb9620
1 changed files with 10 additions and 1 deletions
  1. 10 1
      src/bootstrap-table.js

+ 10 - 1
src/bootstrap-table.js

@@ -524,7 +524,8 @@
         cellStyle: undefined,
         cellStyle: undefined,
         searchable: true,
         searchable: true,
         searchFormatter: true,
         searchFormatter: true,
-        cardVisible: true
+        cardVisible: true,
+        escape : false
     };
     };
 
 
     BootstrapTable.EVENTS = {
     BootstrapTable.EVENTS = {
@@ -827,6 +828,10 @@
                     that.header.stateField = column.field;
                     that.header.stateField = column.field;
                     that.options.singleSelect = true;
                     that.options.singleSelect = true;
                 }
                 }
+                
+                if(column.escape) {
+                	that.options.escapeColumn = true;
+                }
 
 
                 html.push(text);
                 html.push(text);
                 html.push('</div>');
                 html.push('</div>');
@@ -1700,6 +1705,10 @@
                 if (that.options.cardView && !column.cardVisible) {
                 if (that.options.cardView && !column.cardVisible) {
                     return;
                     return;
                 }
                 }
+                
+                if(that.columns[j].escape) {
+                	value_ = escapeHTML(value_);
+                }
 
 
                 style = sprintf('style="%s"', csses.concat(that.header.styles[j]).join('; '));
                 style = sprintf('style="%s"', csses.concat(that.header.styles[j]).join('; '));