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

Using + in ClientTemplate (js-Code)

1 Answer 133 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mathias
Top achievements
Rank 1
Mathias asked on 25 Sep 2012, 09:19 AM

Hi,

I think I found a little (big) bug in the grids ClientTemplate. I use JavaScript-Code in a ClientTemplate. The problem is, that the + sign doesn't work.

Here is what I tried:

.ClientTemplate("<ul>#for(var i = 0; i < myObj.length; i++){#<li>#=myObj[i].Name#</li>#}#</ul>");

I simplified the template a little bit. The fact is, that the i++ in my for-loop doesn't work. It gets to be an endless loop. If I set a debugger in there, I can only see for(var i = 0; i < myObj.length; i ) --> The + signs are missing! And it doesn't matter where I use the +. It isn't displayed when I debugg the code.

I hope you understand what I mean!

My current workaround is to use -(-1) .............. #for(var i = 0; i < myObj.length; i = i-(-1)){#

1 Answer, 1 is accepted

Sort by
0
Brian Roth
Top achievements
Rank 1
answered on 25 Sep 2012, 10:09 PM
Hi Mathias,

Thanks for posting about this!  I ran into the same problem today and was just starting to look for answers.  Your fix works perfectly!  Hopefully the bug can be resolved soon, but at least we have a workaround for now.

Regards,
Brian
Tags
Grid
Asked by
Mathias
Top achievements
Rank 1
Answers by
Brian Roth
Top achievements
Rank 1
Share this question
or