Row Background update not working

Row Background update not working

berukenberuken Posts: 1Questions: 1Answers: 0

I am trying to get an instance of a row object and update the background color. Most responses seem to point to changing color during click or load events. As shown the code has no problem returning the index of a row and a row object I'd like to operate on, but I can't seem to get the color changed. I even tried remove.draw() and nothing. Let me state this fires on a textbox onchange event which seems to place the focus on the first column header.

function searchTable(val) {
        var table = $('#assetTable').DataTable();

        var index = table
     .column(2)
     .data()
     .indexOf(val);

        if (index < 0) {
            alert(val + ' was not found in the result set');
        }
        else {
            //alert(val + ' was found at index: ' + index);
            var row = table.row('#row-' + index);
            row.css({"background-color":"green"});
        }
                 
    }
This discussion has been closed.