Skip to content

Commit

Permalink
[#2319] Clean up field names before rendering the table
Browse files Browse the repository at this point in the history
See datopian/datahub#465 for details

Patching local recline but a PR has been sent to the recline repo:

datopian/datahub#466
  • Loading branch information
amercader committed Feb 26, 2015
1 parent 98cf53d commit b3cd626
Showing 1 changed file with 7 additions and 1 deletion.
Expand Up @@ -4494,10 +4494,16 @@ my.SlickGrid = Backbone.View.extend({
return value;
}
};

function sanitizeFieldName(name) {
var sanitized = $(name).text();
return (name !== sanitized && sanitized !== '') ? sanitized : name;
}

_.each(this.model.fields.toJSON(),function(field){
var column = {
id: field.id,
name: field.label,
name: sanitizeFieldName(field.label),
field: field.id,
sortable: true,
minWidth: 80,
Expand Down

0 comments on commit b3cd626

Please sign in to comment.