how to delete many rows in the same time

how to delete many rows in the same time

dede26589dede26589 Posts: 10Questions: 0Answers: 0
edited December 2013 in General
hi,
how to delete many rows in the same time ?
Thanks in advance

Replies

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395
    Are you using DataTables Editor? If so, why not look at the examples?

    https://editor.datatables.net/release/DataTables/extras/Editor/examples/fieldDefaults.html
  • dede26589dede26589 Posts: 10Questions: 0Answers: 0
    no not the editable table , a simple table
  • allanallan Posts: 63,695Questions: 1Answers: 10,500 Site admin
    In 1.9- use fnDeleteRow with the redraw parameter set to false and then loop over each row to be deleted. Once the loop has ended, use fnDraw to redraw the table.

    In 1.10 you will be able to use `rows().remove()` to delete multiple rows.

    Allan
  • xiaoyuandlgxiaoyuandlg Posts: 4Questions: 0Answers: 0
    I don't know this snippet of deleting rows in C# can be insightful or not for you:
    [code]
    this.ketticGridView.RemoveRows(rowToDelete);
    this.ketticGridView.RemoveRowsAt(0)
    this.productsTableAdapter.Update(this.nwindDataSet.Products);
    [/code]
    Although not the JS, really hope it helps.

    http://www.kettic.com/winforms_ui/csharp_guide/gridview_row_remove.shtml
  • dede26589dede26589 Posts: 10Questions: 0Answers: 0
    i knew fnDeleteRow function, i use it but it is very slow
  • allanallan Posts: 63,695Questions: 1Answers: 10,500 Site admin
    DataTables 1.10 has a `rows().remove()` method which will give the ability to delete multiple rows at the same time.

    Allan
  • allanallan Posts: 63,695Questions: 1Answers: 10,500 Site admin
    Oops - sorry, I just realised I'd said that in my last comment. Sorry for the duplicate :-).

    Allan
  • dede26589dede26589 Posts: 10Questions: 0Answers: 0
    edited January 2014
    the solution is to add null and false :

    fnDeleteRow(rownumber,null,false );


    http://datatables.net/forums/discussion/comment/7585
  • allanallan Posts: 63,695Questions: 1Answers: 10,500 Site admin
    Remember to call fnDraw after you complete your loop.

    Allan
This discussion has been closed.