Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
2745
Row Template Conditions
posted

Using a row template I want to display a different template depending on whether a property on my model is true or false.  Seems rather simple, but for whatever reason that property WILL NOT evaluate correctly if the condition is in its TD CELL in the row template that it is defined in.

Example:

I want to display text if my property IsPublished, is true; otherwise display a button so they can publish the record.  In the attached file that wouldn't formatt correctly on this forum (just one thing after another, I freaking swear), I have an igGrid with two columns.  The first is the boolean I want to evaluate.  Since it won't evaluate in its own TD CELL, I have to create a stupid annoying dummy string property so I can evaluate the boolean in that string TD CELL.  This works.  In fact, anywhere before or after the TD CELL works.  But not in.  For reference "its TD CELL" is in reference to: <td data-key='${IsPublished}'>${IsPublished}</td>

What I can't figure out, is why if i move the same exact condition over one cell it bombs?  Why?  Like most examples, it probably won't get replicated.  Cause the version I attached is stripped down from 10 columns.  I can't post the rest online, only a subset.

I've tried debugging it by adding a space in between of the "{{ if" and I can see that it outputs the value to the following:

  {{if true === true}} Published {{else}} <input button...... />{{/if}}

So I know it looks correct.

 

IE 9, FireFox, Safari all behave the same way.

CDN version 2059

Parents Reply Children
No Data