Skip to content
Browse files

Handle special characters in fields properly, fixes #125

  • Loading branch information...
1 parent c1d560a commit 38e2b613d869d70c0c5caf6c9c9aec2877e1dc99 @kriszyp committed Mar 15, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 Grid.js
View
6 Grid.js
@@ -1,7 +1,7 @@
define(["dojo/_base/kernel", "dojo/_base/declare", "dojo/on", "dojo/has", "put-selector/put", "./List", "dojo/_base/sniff"],
function(kernel, declare, listen, has, put, List){
var contentBoxSizing = has("ie") < 8 && !has("quirks");
-
+ var invalidClassChars = /[^\._a-zA-Z0-9-]/g;
function appendIfNode(parent, subNode){
if(subNode && subNode.nodeType){
parent.appendChild(subNode);
@@ -111,8 +111,8 @@ function(kernel, declare, listen, has, put, List){
column = subRow[i];
id = column.id;
extraClassName = column.className || (column.field && "field-" + column.field);
- cell = put(tag + ".dgrid-cell.dgrid-cell-padding.dgrid-column-" + id +
- (extraClassName ? '.' + extraClassName : ''));
+ cell = put(tag + (".dgrid-cell.dgrid-cell-padding.dgrid-column-" + id +
+ (extraClassName ? '.' + extraClassName : '')).replace(invalidClassChars,'-'));
cell.columnId = id;
if(contentBoxSizing){
// The browser (IE7-) does not support box-sizing: border-box, so we emulate it with a padding div

0 comments on commit 38e2b61

Please sign in to comment.
Something went wrong with that request. Please try again.