Need guidance on cellRenderer

Hi all,
I need to manipulate cellRenderer in a row-by-row basis order to display components based on ‘type’ in a dataProvider. e.g


dataProvider = [ {label:"FName", type:"text", data:"John"}, {label:"Activated", type:"check", data:true} ]

here you would get 2 rows. The first a normal text cell for the data field, The second - a checked checkbox for the data field.

What I have so far is a cellRenderer class which creates both a text field AND a checkbox in the constructor and sets _visibility to hidden. In the method that paints the cell (setValue() ) I change the relevant one visible based on ‘type’ in the dataProvider.

Just wondering if anyone can suggest a better way to do this. The problem is that ‘type’ is not available in the constructor… only after initialization

From what I’ve seen, cellRenderers posts dont seem to get much help but here’s hoping - Just after a bit of direction…

Many thanks.