views:

964

answers:

1

Hello!

I'm trying to add a custom renderer to a ColumnTree in Ext JS. Since it appears(?) that this isn't supported, does anyone know of any workaround to use a renderer? Here's a snippet of code - let's just say (hypothetically) that I have a renderer I'd like to use for the documentsVersion tab below - does anyone have any ideas?

return new Ext.tree.ColumnTree({
    autoHeight: false,
    rootVisible: showRoot,
    autoScroll: false,
    id: (!treeId)? window.mainTreeId: treeId,
    loader: (!loader)?window.docTreeLoader:loader,
    columns: [{
         header:"${documentsTitle}",
         width: windowWidth * 0.40
     },
     {
         header:"${documentsVersion}",
         width: windowWidth * 0.10,
         dataIndex:'version'
     },

Thanks!

A: 

As I can see from this ExtJS forum post they still evaluate renderer column property in their ColumnNodeUI.js subclass for rendering column data.

So you may try to add renderer property along with header, width and dataIndex.

Thevs
I did try this (as I didn't want to waste everyone's time prior to asking) without much success. It could likely be a problem with what I'm doing with the renderer, although the renderer does work elsewhere (using same renderer I use for a Grid Column). I'll poke around with it, thanks :)
Chris Cowdery-Corvan
Maybe you should use an inline renderer function (anonymous function) in this case ?
Thevs
That worked great, thanks.
Chris Cowdery-Corvan