Ticket #12056 (closed bug: invalid)
Insert space before capital letters in jquery template using replace and regex. if $ is there it is not working
| Reported by: | thulasirams1986@… | Owned by: | |
|---|---|---|---|
| Priority: | undecided | Milestone: | None |
| Component: | unfiled | Version: | 1.7.2 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
the below jquery template is not working because f $1
<script id="" type="text/x-jquery-tmpl">
<table>
<tr>
{{each(i, enityCol) WorkColumnNames}}
<th class="SortList">
${String(enityCol).replace(/([A-Z])/g, ' $1')}
</th>
{{/each}}
</tr>
</table>
</script> if i replace $1 by 111 or some word it is working
<script id="" type="text/x-jquery-tmpl">
<table>
<tr>
{{each(i, enityCol) WorkColumnNames}}
<th class="SortList">
${String(enityCol).replace(/([A-Z])/g, ' 111')}
</th>
{{/each}}
</tr>
</table>
</script>
Change History
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

jquery.template is not managed on this bug tracker and is not supported by the jQuery team; you might try StackOverflow.