Success! Looks like we've fixed this one. According to our records the fix was applied for EXTJS-8242 in 4.2.0.489.
  1. #1
    Sencha Premium Member
    Join Date
    Apr 2012
    Posts
    3
    Vote Rating
    0
    huguogang is on a distinguished road

      0  

    Default 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) || '' : '';
    ...
    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;

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,812
    Vote Rating
    836
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    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
    ________________
    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 in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha Premium Member
    Join Date
    Apr 2012
    Posts
    3
    Vote Rating
    0
    huguogang is on a distinguished road

      0  

    Default


    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 + '"' : '') + ' />';

Thread Participants: 1

Tags for this Thread