when size of datatable increased on any event then fnDraw() called then new css does not applied .

when size of datatable increased on any event then fnDraw() called then new css does not applied .

SoniyaGhanghasSoniyaGhanghas Posts: 1Questions: 0Answers: 0

I want to show hide some rows on click event on datatable's fixed column td img element.
Show hide works perfectly but I want to change src of that image on click.
Show hide also call function fnDraw();
After fndraw() the function fndrawcallback is called. but that is also not resolved the problem.

var currentObj=null;
oTable = $('#frozenTable').dataTable({
"bPaginate": false,
"bFilter": false,
"bSort": false,
"sScrollY": "500px",
"sScrollX": "100%",
"sScrollXInner": "100%",
"bScrollCollapse": true,
bAutoWidth: false,
fixedColumns: {
"iLeftColumns": 3,
"fnDrawCallback": function () {
if (currentObj != null)
$(currentObj).find("img").attr("src", "/content/images/icons/minus.png");
},

        }
    });

// method applied on td>img element.
var ExpandCollapse = function (thisClass, obj) {
currentObj = $(obj).closest("tr");
thisClass = 'Channel' + thisClass;
if ($("." + thisClass).hasClass("hide")) {
$("." + thisClass).removeClass("hide");
var oSettings = oTable.fnSettings();
oSettings.oScroll.sY = "400px";
oTable.fnDraw(false);
}
else {
$("." + thisClass).addClass("hide");
}
};

the src of that image not changed.

This discussion has been closed.