Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

  1. #1
    Sencha User
    Join Date
    Sep 2012
    Posts
    3
    Vote Rating
    0
    dmenin is on a distinguished road

      0  

    Default Unanswered: extjs actioncolumn renderer prevents handler

    Unanswered: extjs actioncolumn renderer prevents handler


    I have a actioncolumn on my grid with this code:

    this.columns =
    [
    {
    xtype: 'actioncolumn',
    items: [{
    icon: '../Content/Images/Approve.png',
    handler: function (grid, rowIndex, colIndex, node, e, record, rowNode) {
    alert('test approve')
    }
    }
    ...rest of the columns
    when I click the icon, I get the "test approve" message, so it works as expected!
    If I add the render method bellow to disable the action column for rows that are already approved:

    renderer: function (value, metadata, record) {
    if (record.get('Approved') = 1) {
    this.items[0].disabled = true
    } else {
    this.items[0].disabled = false;
    }
    }
    the handler stops working on the enabled itens. It seems like the renderer function is preventing the handler to be called. I even tried to add the handler code inside the renderer, but also no success.
    Any idea why this would happen?

  2. #2
    Ext JS Premium Member
    Join Date
    Feb 2011
    Posts
    28
    Answers
    1
    Vote Rating
    2
    shmeltex is on a distinguished road

      0  

    Default


    Root of the behavior you seeing is the fact that ActionColumn is only one object. It uses the last value that been set when grid rendered, in your case last value of disabled was true and handler is not being called.
    Version 4.1.2 has nice answer in isDisabled configuration parameter:
    Code:
    this.columns =
    [
      {
        xtype: 'actioncolumn',
        items: [{
          icon: '../Content/Images/Approve.png',
          handler: function (grid, rowIndex, colIndex, node, e, record, rowNode) {
            alert('test approve')
          },
         isDisabled: function (view, rowIndex, colIndex, item, record) {
           return record.get('Approved') == 1;
         }
        }]
      }
    ]

Thread Participants: 1

Tags for this Thread