0

In my datatable, getting result from search button action. So first search results selected row hightlight working good , but again search those results are not highlighting .why second time selected row high light is not working good ? Please advise...

This demo not simulated the issue which i mention , but similar way the works datatable..

Demo : demo

$('#products1 tbody tr').live("click", function () {

    if ($(this).hasClass('selected1')) $(this).removeClass('selected1');
    else
    {

        $(this).siblings('.selected1').removeClass('selected1');
        $(this).addClass('selected1');
    }

     $("#dialog-form").data('rows', oTable.fnGetData( this ));

});
user2535783
  • 13
  • 1
  • 4

1 Answers1

0

Please try to use the fnCreateRow callback.

"fnCreatedRow": function( nRow, aData, iDisplayIndex ) {
    $(nRow).on('click', function (){
        if ($(this).hasClass('selected'))           
            $(this).removeClass('selected');
        else
        {
            $(this).siblings('.selected').removeClass('selected');
            $(this).addClass('selected');
            $("#dialog-form").data('rows', oTable.fnGetData( this ));

        }

    });   
}

I've updated the jsFiddle. http://jsfiddle.net/rwPFx/37/

I hope it helps.

Regards,

simongus
  • 440
  • 2
  • 6