Updating properties of only a given column

Updating properties of only a given column

lgupta1lgupta1 Posts: 5Questions: 0Answers: 0
edited December 2012 in General
I am initializing all my datatables like this

$('.dataTable').dataTable({
"sPaginationType" : "full_numbers"
});

After I have done the initialization, I now want to set properties on some of the columns of a specific datatable.

Is there a function like getColumnByName that I can use and then use the column object to set some properties on it ?

In pseudo-code this is what I would like to do:

var column = myTableObj.getColumnByName("aNumericColumn");
column.setRenderer("RenderDecimalNumber");
column.setProperty("decimalPlaces" , "2");

myTableObj.redraw();

Replies

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    Currently no - although column specific operations will be added in 1.10. Having said that, initialisation options such as setting a renderer are only available at initialisation time and cannot be changed after initialisation.

    A longer term plan for DataTables will be to offer that ability, but I'm afraid it is not present at the moment - you need to set such options up front.

    Allan
  • lgupta1lgupta1 Posts: 5Questions: 0Answers: 0
    Thank you.
This discussion has been closed.