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

1 posts, 0 answers
  1. Michael
    Michael avatar
    8 posts
    Member since:
    Apr 2012

    Posted 20 Aug 2012 Link to this post

    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>
Back to Top