开发者

jQuery Template Ignores String.Empty Values

I have an ASP .Net Webservice which returns a System.Data.DataTable like object (contains rows and columns, with the cell values being strings) which is serialised to JSON.

I want use this data table JSON result to populate an HTML table using jQuery Template.

If a row contains an empty cell (String.Empty) I still want it to print <t开发者_运维知识库d></td> else my table structure will get messed up. jQuery template seems to be treating String.Empty as null and skipping it rather than including an empty table cell.

Example of my JSON row

{"ItemArray":["Job 1 Status","Completed","","Active","Failed","Completed"]}]}

Example of my templates

<script id="tableRowTemplate" type="text/x-jquery-tmpl">
    <tr>{{tmpl(ItemArray) "#tableRowCellTemplate"}}</tr>
</script>
<script id="tableRowCellTemplate" type="text/x-jquery-tmpl">
        <td>${}</td>
</script>

I am using jQuery 1.6.4 and jQuery template 1.0.0pre. I could quite easily replace String.Empty with a pending status and then check for this in my template, but I would rather not do a workaround.

Update: The jQuery template project has been abandoned in its current form.


This question seems to have become active again—unlike this jQuery template project.

The jQuery template project is dead and never made it out of beta, so the answer is that there is no solution.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜