0

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.

Yurii
  • 4,811
  • 7
  • 32
  • 41
Rahul
  • 21
  • 2
  • Which version of Fuel UX are you using? 2.6.x or 3.0.x? I'm guessing Fuel UX 2 since you refer to the control as a datagrid instead of repeater. If it's 2, then is may be a bug in a deprecated version. If it's Fuel UX 3. I might be able to work with you to get this added as a feature in an upcoming release. – Interactive Llama Oct 05 '14 at 16:11
  • @InteractiveLlama: I am using FuelUX 2.6.1. Will FuelUX 3.1 resolve my problem and recognize \n as new line ? – Rahul Oct 06 '14 at 07:14
  • I just know that we aren't modifying 2.x much these days. You may need to refactor things for 3.1 though. There are breaking changes. I do know that 2.6 datagrid uses $.html() for adding text and FuelUX uses $.append(). – Interactive Llama Oct 06 '14 at 14:45

0 Answers0