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

Handle Null in View Model when using "text/x-kendo-template"

0 Answers 72 Views
ListView
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 20 Aug 2012, 05:21 PM
When any of the ${} below are null, or not provided, it wraps as if the <dd></dd> doesn't exist.  
How do I handle the if(${MiddleName}) !== NULL) then ${MiddleName} for example...

<div class="contact-research-view">         
<dl>             
<dt>Conact Id:</dt><dd>${ContactId}</dd>             
<dt>Honorific:</dt><dd>${Honorific}</dd>             
<dt>First Name:</dt><dd>${FirstName}</dd>             
<dt>Middle Name:</dt><dd>${MiddleName}</dd>             
<dt>Last Name:</dt><dd>${LastName}</dd>             
<dt>Suffix:</dt><dd>${Suffix}</dd>             
<dt>Primary Address Line 1:</dt><dd>${PrimaryAddressLine1}</dd>             
<dt>Primary Address Line 2:</dt><dd>${PrimaryAddressLine2}</dd>             
<dt>Primary Address City:</dt><dd>${PrimaryAddressCity}</dd>             
<dt>Primary Address StateOrProvince:</dt><dd>${PrimaryAddressStateOrProvince}</dd>             
<dt>Primary Address PostalCode:</dt><dd>${PrimaryAddressPostalCode}</dd>             
<hr/>             
<dt>Account Address Line 1:</dt><dd>${AccountAddressLine1}</dd>             
<dt>Account Address Line 2:</dt><dd>${AccountAddressLine2}</dd>             
<dt>Account Address City:</dt><dd>${AccountAddressCity}</dd>             
<dt>Account Address StateOrProvince:</dt><dd>${AccountAddressStateOrProvince}</dd>             
<dt>Account Address PostalCode:</dt><dd>${AccountAddressPostalCode}</dd>             
</dl>     
</div>

No answers yet. Maybe you can help?

Tags
ListView
Asked by
Michael
Top achievements
Rank 1
Share this question
or