Hi,
I'm migrating a project from ASP.NET MVC Extensions to KendoUI. I'm trying to figure out the best way to re-create this grid binding using KendoUI and without any serverside code. I can't find anything to do with onRowDataBound or similar in the documentation.
As you can see, as each row is databound, it attaches the countdown jquery plugin (http://keith-wood.name/countdown.html) and uses the current dataItem's Due datetime value.
Is the only way to do this using javascript inside the <script id="rowTemplate" type="text/x-kendo-tmpl"> element?
How can I recreate this to work with KendoUI?
This is sample output for one row once it has been rendered:
Thanks
I'm migrating a project from ASP.NET MVC Extensions to KendoUI. I'm trying to figure out the best way to re-create this grid binding using KendoUI and without any serverside code. I can't find anything to do with onRowDataBound or similar in the documentation.
As you can see, as each row is databound, it attaches the countdown jquery plugin (http://keith-wood.name/countdown.html) and uses the current dataItem's Due datetime value.
Is the only way to do this using javascript inside the <script id="rowTemplate" type="text/x-kendo-tmpl"> element?
How can I recreate this to work with KendoUI?
function onRowDataBound(e) { e.row.cells[2].innerHTML = "<span class='countdown-" + e.dataItem.SONumber + "'></span>" if (e.dataItem.Due != null && e.dataItem.Due < new Date(2015, 4, 1) && e.dataItem.Due > new Date(2011, 4, 1)) { $('.countdown-' + e.dataItem.SONumber).countdown({ until: new Date(Date.parse(e.dataItem.Due)), compact: true, layout: '<strong>{dn} {dl} {hnn}{sep}{mnn}{sep}{snn}</strong>', }); } }This is sample output for one row once it has been rendered:
<tr style="background: none repeat scroll 0% 0% rgb(255, 134, 112);"> <td>43475</td> <td>New</td> <td> <span class="countdown-43475 hasCountdown"> <strong>0 d 00:00:00</strong> </span> </td> <td>Account</td> <td>Description</td> <td>Cons</td> <td class="t-last">P3 - 24H</td></tr>