-
15 Jan 2013 11:26 AM #1
ActionColumn 'getClass' is not getting the data passed in
ActionColumn 'getClass' is not getting the data passed in
ExtJS, version 4.1.1.a
ActionColumn > Ext.define.defaultRender
Problem: argument passed into function (v) changed inside the function to html string.
Original code:v = Ext.isFunction(me.origRenderer) ? me.origRenderer.apply(scope, arguments) || '' : '';Should be changed to something like:
...
v += '<img....
...
return v;var ret = Ext.isFunction(me.origRenderer) ? me.origRenderer.apply(scope, arguments) || '' : '';
...
ret += '<img....
...
return ret;
-
15 Jan 2013 1:07 PM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,677
- Vote Rating
- 435
Just creating a new variable isn't going to change the function of the defaultRenderer. The v variable isn't used in the method other than what the ret variable would be. Show me a test case that would produce unwanted behavior.
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
15 Jan 2013 1:56 PM #3
Browser: Google Chrome 24.0.1312.52 m
Best practice aside, this problem did cause problem in the "getClass" callback.
Using "v" to build HTML changed "arguments", thus changed the parameters passed to "getClass". In my case, the "v" passed to getClass is always empty string, instead of the expected "The value of the column's configured field". After my changes, getClass behaves as expected. Check the highlighted part below if I was not clear.
v += '<img alt="' + (item.altText || me.altText) + '" src="' + (item.icon || Ext.BLANK_IMAGE_URL) +
'" class="' + prefix + 'action-col-icon ' + prefix + 'action-col-' + String(i) + ' ' + (item.disabled ? prefix + 'item-disabled' : ' ') +
' ' + (Ext.isFunction(item.getClass) ? item.getClass.apply(item.scope || scope, arguments) : (item.iconCls || me.iconCls || '')) + '"' +
((item.tooltip) ? ' data-qtip="' + item.tooltip + '"' : '') + ' />';
You found a bug! We've classified it as
EXTJSIV-8242
.
We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.


Reply With Quote