[#465] Sanitize header name on SlickGrid view

Change logic of sanitizing. Previously either original value
or content of element with matching selector was used as column
header.

After this change original value with applied encoding of
html entities will be used
This commit is contained in:
Motornyuk Sergey 2016-04-05 12:54:43 +03:00
parent 10f115f778
commit 24388b7e6c

View File

@ -161,13 +161,7 @@ my.SlickGrid = Backbone.View.extend({
}
function sanitizeFieldName(name) {
var sanitized;
try{
sanitized = $(name).text();
} catch(e){
sanitized = '';
}
return (name !== sanitized && sanitized !== '') ? sanitized : name;
return $('<div>').text(name).html();
}
_.each(this.model.fields.toJSON(),function(field){