Angular ng-style不能使用kendo网格

时间:2017-06-02 12:59:39

标签: angularjs kendo-grid

当姓氏为空时,我无法在网格中添加蓝色。

我正在使用Kendo网格,我不太熟悉如何在kendo行模板中编写角度代码。

这是我的代码:http://dojo.telerik.com/@marcosjroig/eQUye

1 个答案:

答案 0 :(得分:0)

您只需将stringfied对象传递给Style列中可用的<td ng-style= "#: Style && JSON.stringify(Style) #"> #: Surname # </td>

 vm.allGroupsInClassifications = [];
 datacontext.graph.getAllGroups().then(function (data) {

            var groups = [];

            // get all clasification names and put them in the array and create a new array
            for (var k in vm.classificationNames) {
                var groupName = vm.classificationNames[k];
                groups[groupName] = new Array();
            }

            // go through all the groups and sort them based on their classification
            for (var i = 0; i < data.length; i++) {

                if (data[i].classification != null) {
                    modifyGroupContent(data[i], groups, 0);
                }
                else if (data[i].classification == null) 
                    modifyGroupContent(data[i], groups, 1);
                }


            vm.allGroupsInClassifications = groups;
            console.log(vm.allGroupsInClassifications);

Dojo