Success! Looks like we've fixed this one. According to our records the fix was applied for
EXTJS-8242
in
4.2.0.489.
-
Sencha Premium Member
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) || '' : '';
...
v += '<img....
...
return v;
Should be changed to something like:var ret = Ext.isFunction(me.origRenderer) ? me.origRenderer.apply(scope, arguments) || '' : '';
...
ret += '<img....
...
return ret;
-
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.
-
Sencha Premium Member
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 + '"' : '') + ' />';