I have created a dynamic datasource for Fuelux datagrid. I create it using Json.Parse('@Html.Raw(Model.datasource)')
method. Where datasource
contains list of objects to be displayed in the grid.
But when the datasource contains a '\n'
(or '\t'
etc.) it gives me a parsing error. So I replace it using '@Html.Raw(Model.dataSource)'.replace(/[\n]/g, '\\n')
so that it escapes '\'. It works fine without any error but the Column contains '\n'
as text rather than displaying text in new line.