PDA

View Full Version : Where to specify "renderer" function for a grid column



biscuit314
11 Feb 2012, 4:23 PM
I have a grid with a column for which I want to specify a renderer function. In Ext Designer 1.2.2 Build 48 I would do this by promoting the column to a class, which of course causes designer to emit a javascript file for that class. The comments in this new file say "You should implement event handling and custom methods in this class". I do so - add the renderer function and Bob's your uncle.

In Designer 2.0.0 Build 279 I do the same thing and it works there too - until I redeploy. Then the javascript for the column class is overwritten and I lose the renderer function.

I have implemented most other event handlers through the new GUI (nice feature, btw!) but I can't find where to implement renderer.

Am I doing something wrong, or is this a bug?

biscuit314
11 Feb 2012, 5:57 PM
I think I found the answer: Unlike the older version, Designer 2.0 saves the generated class files alongside the xds file. I modified the file there, and the changes came along for the ride when deploying.

aconran
13 Feb 2012, 10:39 AM
The renderer will be coming along as a configuration in a version in the near future.

As stated though you can stick this in your implementation file and you are good to go.

g13013
18 Feb 2012, 5:46 PM
I found another way to do it without touching the files generated and it works just fine;

1- add a Basic Function to the grid and name it ex:ColRenderer
2- add an "added" event to the column you want to assign the renderer ans set Single to True (to fire it just on time)
3- in event code editor assign the renderer like this: abstractcomponent.renderer=this.ColRenderer;

:)
waiting to a proper way to do it

EAHC-IT
13 Apr 2012, 12:00 AM
I found another way to do it without touching the files generated and it works just fine;

1- add a Basic Function to the grid and name it ex:ColRenderer
2- add an "added" event to the column you want to assign the renderer ans set Single to True (to fire it just on time)
3- in event code editor assign the renderer like this: abstractcomponent.renderer=this.ColRenderer;

:)
waiting to a proper way to do it

Hello,
Do you have an code example?



,
"gridcolumn[id=gp_lop_pdbs]": {
added: this.onGridcolumnAdded
}
...
,


onGridcolumnAdded: function(abstractcomponent, container, pos, options) {
/**
* Event: ...
*
* Controller Action : on ...
*
* Actions:
*
* - ...
*
*/
abstractcomponent.renderer=this.ColRenderer(abstractcomponent);
},


ColRenderer: function(oObj) {
var newVal = oObj.value + 11;
return newVal;
}

EAHC-IT
13 Apr 2012, 12:32 AM
Forget, I found out


onGridcolumnAdded: function(abstractcomponent, container, pos, options) {
/**
* Event: ...
*
* Controller Action : on ...
*
* Actions:
*
* - ...
*
*/
abstractcomponent.renderer=function(value){
if (value === 1) {
return 'Yes';
}
return 'No';
};
}

aconran
13 Apr 2012, 9:51 AM
Renderer has been in as a configuration of a column for quite some time.

EAHC-IT
15 Apr 2012, 10:31 PM
Renderer has been in as a configuration of a column for quite some time.
I know, but not not through the Designer

aconran
16 Apr 2012, 10:02 AM
Yes, through Designer. Search for renderer and then click the +

EAHC-IT
16 Apr 2012, 11:15 PM
Yes, through Designer. Search for renderer and then click the +
Hi, On which version of the Designer? I have 2.0.0 Build 268 / 2.0-beta‚Äč

aconran
17 Apr 2012, 6:10 AM
EAHC-IT - I don't know what build it went out with. New installers are available with the GA release of the product. The latest build is 410.
http://www.sencha.com/blog/sencha-architect-html5-app-builder-for-touch-and-ext-js/

billtricarico
27 Apr 2012, 12:13 PM
I am using Designer/Architect 2 build 410 and I am having an issue with the column renderer. I added a function to my gridcolumn/numbercolumn called renderer, with the parameter value, and threw a console.log() in there to see what's going on.

I am not seeing any console output and the renderer is not working. it's like the render function is not being called.