how to add a custom column dynamically in ajax grid

how to add a custom column dynamically in ajax grid

maheshmmaheshm Posts: 2Questions: 0Answers: 0
edited September 2013 in DataTables 1.9
I configured ajax grid and I'm getting json data from a url and displaying it in a grid. and my requirement is for each row I have to display a check box at the first column to select that entire row. so can you check the following code and explain please how to tweak it

"fnServerData": function( sUrl, aoData, fnCallback ) {
aoData.push( { "name": "more_data", "value": "my_value" } ); // Added to insert new component dynamically, but didn't worked
$.ajax( {
"url": sUrl,
"data": aoData,
"success": fnCallback,
"dataType": "json",
"cache": false
} );
}

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    Use aoColumns with an mData / mRender function the dynamically create column. Example used to create links: http://editor.datatables.net/release/DataTables/extras/Editor/examples/envelope_inline.html

    Allan
  • maheshmmaheshm Posts: 2Questions: 0Answers: 0
    Thanks Allan for your reply, and it is worked for me :)
This discussion has been closed.