I want to change font color of a row on the basis of column value in Kogrid? Please guide on how can I set it? I have tried following:
<div id="grid" style="height: 700px; width: 650px;"
data-bind="koGrid: {
data: gridItems, afterSelectionChange: function (rowItem, event) {
if (event.type == 'click' && isDoubleClick(self.clickTime, event.timeStamp)) {
location.href = '/Home/Index?AcctID=' + selObj()[0].AcctID.toString();
}
}, columnDefs: [{ field: 'AcctID', displayName: ' ',width: 120, cellTemplate: $('#editCellTemplate').html()
},
{ field: 'AcctID', displayName: ' ',width: 120, cellTemplate: $('#openCellTemplate').html()
},
{ field: 'FName', displayName: 'First Name', width: '150' },
{ field: 'LName', displayName: 'Last Name', width: '100' },
{ field: 'AcctID', displayName: 'AcctID', width: '100' },
{ field: 'SSN', displayName: 'SSN', width: '100' },
{ field: 'AffinityName', displayName: 'Affinity Name', width: '205' }],
autogenerateColumns: false,
isMultiSelect: false,
showFilter: true,
showColumnMenu: true,
enablePaging: false,
showGroupPanel: true,
displaySelectionCheckbox: false,
enableColumnResize: false,
multiSelect: false,
selectedItems: selObj,
canSelectRows: true ,
rowTemplate:$('#searchRowTemplate').html()
}">
</div>
<script type="text/html" id="searchRowTemplate">
<div data-bind="foreach: $grid.visibleColumns,
css: { red: getProperty(\'SSN\') == '123456789' }">
<div data-bind="attr: { \'class\': cellClass()
\' kgCell col\' + $index() }, kgCell: $data"></div>
</div>
</script>
It gives :- Uncaught SyntaxError: Unable to parse bindings. Bindings value: foreach: $grid.visibleColumns, css: { red: getProperty(\'SSN\') == '123456789' } Message: Unexpected token ILLEGAL
Don't know how to get red font color for complete row where my column ssn = 123456789 and fname = john.
Please suggest a solution.