Good code red

2 posts, 0 answers
  1. Stuart Hemming
    Stuart Hemming avatar
    1622 posts
    Member since:
    Jul 2004

    Posted 12 Jun 2012 Link to this post

    I'm using client templates in RadListView and have code that looks like this...
    <ItemTemplate>
        <div class="item item_#=owner.Skin# #=isSelected ? String.format('selected selected_{0}', owner.Skin) : '' #" onclick="itemSelected('#=index#', '#=dataIndex#')">
            <div><strong>#= String.format("{0}, {1}", Surname, Forename) #</strong></div>
            <div>#= OrganisationName #</div>
            <div>#= BusinessEmail #</div>
            <div>#= String.format("{0} ext {1}", BusinessPhone, BusinessPhoneExt) #</div>
            <div style="display:none;">
                <input type="checkbox" id="canAddContact" value="canAddContact" #= getPermissions("Add", OwnerGroupId) # />
                <input type="checkbox" id="canAddAdHocContact" value="canAddAdHocContact" #= getPermissions("AddAdHoc", OwnerGroupId) # />
                <input type="checkbox" id="canEditContact" value="canEditContact" #= getPermissions("Edit", OwnerGroupId) # />
                <input type="checkbox" id="canEditAdHocContact" value="canEditAdHocContact" #= getPermissions("EditAdHoc", OwnerGroupId) # />
            </div>
        </div>
    </ItemTemplate>
    This code does exatly what it's supposed to do, however JustCode's analysis tool doesn't like it (see SS1.png)

    I think I can understand why it's having a sulk, but I imagine that it's going to encounter more and more code like this as client templates become more widely used.

    --
    Stuart

  2. Svetlozar
    Admin
    Svetlozar avatar
    269 posts

    Posted 19 Jun 2012 Link to this post

    Hi,

    Thank you for your feedback. We still don't support the template binding syntax. I logged it in our system.

    Kind regards,
    Svetlozar
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. DevCraft banner
Back to Top