kendo grid上的模版示例

                {
                    field: "SCORE",
                    title: "分数",
                    attributes: {
                        style: "text-align:center"
                    },
                    headerAttributes: {
                        style: "text-align:center"
                    },
                    template: GetScoreTemplateText
                },

下面是模版的内容:

    function GetScoreTemplateText(item) {

        var result = "<table>";

        if (item) {
            for (var i = 0; i < item.WorksInfo.length; i++) {
                result += "<tr>";
                result += "<td>" +item.NAME+ "</td>";
                result += "<td>" + item.SCORE+"</td>";
                result += "</tr>";
                result += "<tr>";
            }
        }
        result += "</table>";
        return  result;
    }

 

posted @ 2020-04-20 15:52  星星c#  阅读(228)  评论(0编辑  收藏  举报