This is a migrated thread and some comments may be shown as answers.

Kendo grid blowing up when properties have spaces

0 Answers 74 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Triple
Top achievements
Rank 1
Triple asked on 13 Apr 2012, 01:00 PM
Hello-

I'm trying to use Kendo grid and so far it's pretty good.  The one thing I don't heart about it is that when you do
$("#mydiv").kendoGrid( { dataSource: myJsonObjects })
it takes the explicit property name.  For a good user experience, CamelCasing isn't awesome.  Instead, I'd like to have my columns in English, so I would not want
"AccountName" and "ThisIsAColumnThatIsHardToRead"
but rather
"Account Name"  and "This Is a Column That Is Easy To Read".

So I walk my JSON objects and insert spaces in the property names (this is unusual but 'legal' in Javascript).  But when I hand this revamped object list to Kendo, I get an error:
Invalid template: '<tr><td>#=Account
Name"</td><td>#=This Is A Column That Is Easy To
Read</td></tr>'enerated code:'var
o,e=kendo.htmlEncode;with(data){o='<tr><td>'+(Account Name)
+'</td><td>' + (This Is A Column That Is Easy To Read) +
'</td></tr>';>return o;'

No answers yet. Maybe you can help?

Tags
Grid
Asked by
Triple
Top achievements
Rank 1
Share this question
or