Sorting with Image (image will be changing by event) - not working

Sorting with Image (image will be changing by event) - not working

gunaag4gunaag4 Posts: 1Questions: 0Answers: 0
edited September 2013 in Plug-ins
Please help me on the issue allan.
I use jQuery 1.8.2 and the datatables 1.9.4. In my table i render a (Add) image using mRender. Onclick of the image it adds the row into another table and changed the image to (Remove). but when i sort the image column it is considering the old image. I tried the sort plug-in but nothing works for me. Would you please help me.
Here is my table initialization:
var oTable = $('#example').dataTable(
{
"bJQueryUI": true,
"iDisplayLength": 27,
"aLengthMenu": [[27, 35, 50, 100, -1], [27, 35, 50, 100, "All"]],
"aoColumnDefs": [
{
"aTargets": [ 3 ],
"mRender": function ( data, type, full ) {
return getAddToCartImage();
},
"sSortDataType": "dom-img",
"sType": "string"
}
],
"sAjaxSource": '../data/reprint.txt',
"sPaginationType": 'full_numbers',
"bProcessing": true,
"sDom": '<"H"Tl<\"toolbar\">fr>t<"F"ip>',
"oLanguage": {
"sInfo": "Showing _START_ to _END_ of _TOTAL_ documents"
}
}
);
Sorting data provider: it has the latest changes but the sorting is not using this.
$.fn.dataTableExt.afnSortData['dom-img'] = function ( oSettings, iColumn )
{
var aData = [];
$( 'td:eq('+iColumn+') img', oSettings.oApi._fnGetTrNodes(oSettings) ).each( function () {
aData.push(this);
} );
return aData;
};


JS included
This discussion has been closed.