Using jQuery DataTables plugin, does fnAddData() add rows to the top or bottom of an html table?

前端 未结 3 2009
梦如初夏
梦如初夏 2021-01-05 11:50

I have tested this and the reason I asked the question is that it seems to be doing different things for different tables.

I couldn\'t find any documentation on if t

3条回答
  •  执笔经年
    2021-01-05 12:19

    I have looked at the source code and fnAddData calls the internal method _fnAddData, which adds one row and if successful, returns its index in the table. _fnAddData adds the new row at the bottom (the index of the new row equals the number of the rows in the table).

    However, fnAddData has an optional parameter to redraw the table taking into account the various features which are enabled. This parameter defaults to true and this is what probably causes the 'random' behavior.

提交回复
热议问题