jquery DataTables - change value of a cell not just display value

后端 未结 2 663
無奈伤痛
無奈伤痛 2021-02-19 05:06

Using DataTables I want to change the value of the data before rendering the table. I used this:

\"fnRowCallback\": function( nRow, aData, iDisplayIndex ) {
             


        
2条回答
  •  梦如初夏
    2021-02-19 05:14

    You should probably paste some more of your code, especially the sorting area.

    It seems you're mixing up val() and html():

    This will get you the input or cell value as in the value tag "value=?"

    $("#currentRow").val()
    

    This will get you the actual html (data) between the tag "data"

    $("#currentRow").html()
    

提交回复
热议问题