Having multiple initialisations to a single table. Possible?

Having multiple initialisations to a single table. Possible?

RourkeRourke Posts: 3Questions: 0Answers: 0
edited July 2012 in General
I would like to setup a default initialisation for every table that has the class .dataTable. But I would also like to extend that initialisation if it has certain other classes added to it.

Example. I have a cars table with 2 classes: .dataTable and .carsDataTable. I want all tables with .dataTable to have 'full_numbers' for 'sPaginationType' and 'bJQueryUI' to be 'true'.
But for this .carsDataTable I also want to add 'bStateSave' to be 'true' and a custom function for allowing to click a row and select the checkbox in that specific row.

Is it possible to define multiple initialisations to a single table? I searched for this, but I couldn't find it. I would appriciate an example if possible :)

Replies

  • allanallan Posts: 63,161Questions: 1Answers: 10,406 Site admin
    Interesting idea doing it this way. currently, no this is not possible - you would need to simply use selectors and initialise the table as required. One way of doing it might be to have a function that you pass the class names into and it will built the init object based on those available classes names, pass the object back and you can use that for initialisation.

    Allan
  • RourkeRourke Posts: 3Questions: 0Answers: 0
    Thanks Allan. Good outside the box thinking. I'll play with that idea.
This discussion has been closed.