in Style I have
.rating {
text-align: center;
}
.highlight{
background-color:#FFAAAA;
}
</style>
HTML Body Code
Controller code
‘use strict’;
/* App Module */
webix.i18n.decimalFormat = webix.Number.numToStr({
groupDelimiter: ‘,’,
groupSize: 3,
decimalDelimiter: ‘.’,
decimalSize: 2
});
var app = angular.module(‘webixApp’, [ “webix” ]);
app.controller(“webixTestController”, function ($scope) {
function mark_update(value) {
if (value > 0)
return “highlight”;
};
$scope.records = [
{ id:1, title:“The Shawshank Redemption”, year:1994, votes:678790, rating:9.2, rank:1},
{ id:2, title:“The Godfather”, year:1972, votes:511495, rating:9.2, rank:2},
{ id:3, title:“The Godfather: Part II”, year:1974, votes:319352, rating:9.0, rank:3},
{ id:4, title:“The Good, the Bad and the Ugly”, year:1966, votes:213030, rating:8.9, rank:4},
{ id:5, title:“My Fair Lady”, year:1964, votes:533848, rating:8.9, rank:5},
{ id: 6, title: “12 Angry Men”, year: 1957, votes: 164558, rating: 8.9, rank: 6 }
];
$scope.addRecord = function () {
var record = $$(“grid”).getItem(4);
record[“votes”] = 80;
$$(“grid”).updateItem(4, record);
$scope.records.push({
title:"New Record",
rating:999,
votes:0,
year:2013
});
};
$scope.random = function () {
$scope.records.forEach(function (v, k) {
$scope.$apply(
function () {
v.votes = Math.random();
$$("grid").updateItem(v.id, v);
}
);
});
}
setInterval(function () {
console.log(‘wtf’);
$scope.random();
}, 1000);
});
Hope this helps
Thanks
Toshendra