Deleting the row Dynamically

Deleting the row Dynamically

techsentechsen Posts: 5Questions: 0Answers: 0
edited January 2013 in General
Hi,

I need to delete the row, within the "fnRowCallback" function which will be generated dynamically.
example scenario, I am generating the row with ids within the fnRowCallback function, in that i want to delete the specific row by checking some condition for example : if if(aData[0]=='139') i need to delete that row should not allow to display in tha datatable and further it should not affect the pagination and other properties in datatable.

ex code :"fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) {
if(aData[0]=='139'){
$('#example_'+sel_tab+'_'+id).dataTable().fnDeleteRow( 0 );
}

Please help me on this

Replies

  • techsentechsen Posts: 5Questions: 0Answers: 0
    Hi allan any suggestions from your side
  • varaprasadreddyvaraprasadreddy Posts: 8Questions: 0Answers: 0
    Hi check this link it may help U

    http://reddyinfosoft.blogspot.in/2012/12/jquery-datatable-plugin-in-aspnet-using_15.html

    http://reddyinfosoft.blogspot.in/2012/12/jquery-datatable-plugin-in-aspnet-using.html

    http://reddyinfosoft.blogspot.in/2013/01/search-jquery-datatable-from-external.html
  • techsentechsen Posts: 5Questions: 0Answers: 0
    Hi Varaprasad,

    Thanks for the post..
    But what I actually need is,when we are populating the row in the datatable, if the row data has some condition, assume if the row data is equal to 10(row==10), then this specific row would be deleted in the datatable while displaying...I have used like this

    oTable.fnDeleteRow(iDisplayIndex);

    and i have used the ajax call, when i use the above code, the ajax call is happening 10 times.. i have placed this code in fnRowCallback...

    How to stop this and where i need top place the code, if the code is rite? please give the soln for this.
  • techsentechsen Posts: 5Questions: 0Answers: 0
    Body
This discussion has been closed.