Grid - Custom cell template (Client mode)


Fax:${Fax}
Call:${Fax}
${ContactTitle} ${City}

About this example


This demo shows how to custom the cell template on client side.
It's different from Server template, the DJME Grid client cell template is base on jQuery template. You can use Template(Action tmpl)method to custom the field client template and you can use ${FieldName} to referece your field value in template.

<% 
    Ajax.Dna().Grid()
       .ClientBind(Url.Action("ClientBinding", "Grid"))
       .Columns(cols =>
       {
           cols.Bound(m => m.ContactName).Width(100).Template(() => {
           %>
           <div>${ContactName}div>
           <div style="color:GrayText">Fax:${Fax}div>
           <div style="color:GrayText">Call:${Fax}div>
           <%
           });
       })
       .Render(); 
%>


About the jQuery template you can read this document:"jQuery-templ"