# Need guidance on cellRenderer

**URL:** https://forum.kirupa.com/t/need-guidance-on-cellrenderer/256532
**Category:** Uncategorized
**Created:** [April 3, 2008, 9:06pm UTC](https://forum.kirupa.com/t/need-guidance-on-cellrenderer/256532 "2008-04-03T21:06:52Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![scooby56](https://avatars.discourse-cdn.com/v4/letter/s/90db22/32.png) [@scooby56](https://forum.kirupa.com/u/scooby56)
#### Post date: [April 3, 2008, 9:06pm UTC](https://forum.kirupa.com/t/need-guidance-on-cellrenderer/256532/1 "2008-04-03T21:06:52Z")

</div>

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

```auto

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.
