I want to apply backcolor from dynamically using knockout.js Viewmodel.
Like In HTML
<table border="1" > // I need back color over here
<tbody>
<tr>
<td>
…………
My ViewModel
function SelfEmpPerformance() {
var that = this;
that.departcompetencebackcolor = ko.observable('');
$.ajax({
type: "GET",
cache: false,
url: baseUrl() + "/EmpSelfReview/GetSelfReviewData",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (data) {
if (data.Success == 1) {
that.departcompetencebackcolor(data.SelfEmpPerformance.
departcompetencebackcolor);
}
}
});
}
I need to set color code on table which is in the departcompetencebackcolor property .