Line breaks inside templates
Hi After upgrading to the 12.1 release the row templates logic gets ignored when they contain line-breaks.
I define the templates inside a script block e.g.
<script id="rowTemplate" type="text/x-jquery-tmpl">
<tr>
<td>
<div>$i</div>
</td>
</tr>
</script>
And referenced as follow:
rowTemplate: $("#rowTemplate").text()
It makes the templates allot neater and effortless to update than when dealing with very complex column templates, rather than having the whole template on a single line.
I am able to implement it like this if I strip the line breaks from the text like:
rowTemplate: $("#rowTemplate").html().replace(/(\r\n|\n|\r)/gm,""),
Hi there,
You can use $.trim on $('#id').text(). It will do the same thing. Let me know if this works!
Thanks!
Hi Konstantin
I gave your suggestion a try and it was a nogo. I ended up using:
rowTemplate: $("#rowTemplate").html().replace(/(\r\n|\n|\r)/gm,"")
Thanks
Christoff