1. #511
    Sencha User
    Join Date
    May 2007
    Posts
    64
    Vote Rating
    0
    Specks is on a distinguished road

      0  

    Default


    It does work. But the wrong column number is passed in to the callback.
    The best advice I've been given ... Read the code.

  2. #512
    Sencha - Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    26,130
    Vote Rating
    81
    jsakalos is a splendid one to behold jsakalos is a splendid one to behold jsakalos is a splendid one to behold jsakalos is a splendid one to behold jsakalos is a splendid one to behold jsakalos is a splendid one to behold jsakalos is a splendid one to behold

      0  

    Default


    I see, that I haven't checked. Anyway, I wouldn't rely on col but on action argument. There is something strange in GridView code - I'm going to file a bug report.

    EDIT: I've clarified it myself.

  3. #513
    Sencha - Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    26,130
    Vote Rating
    81
    jsakalos is a splendid one to behold jsakalos is a splendid one to behold jsakalos is a splendid one to behold jsakalos is a splendid one to behold jsakalos is a splendid one to behold jsakalos is a splendid one to behold jsakalos is a splendid one to behold

      0  

    Default


    Try it now.

    Explanation: The problem is that RowActions are used as Column before they are initialized in Ext 3 so id doesn't exist yet when ColumnModel runs. I've used brute force to put RowActions column to lookup variable.

  4. #514
    Sencha User
    Join Date
    May 2008
    Posts
    180
    Vote Rating
    0
    archmisha is on a distinguished road

      0  

    Default


    Hi jsakalos,
    I've started using your RowActions extension, and i have a question about
    hideMode.

    I am trying to achive the following, and i am not quite understand how this hideMode works:
    I have a grid, each row got some column with combo box, and i want when some values in the combo are selected to display the actions and sometimes not.
    How can i trigger the hideMode thingy on runtime per row?

    Thanks, your extension is great

  5. #515
    Sencha - Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    26,130
    Vote Rating
    81
    jsakalos is a splendid one to behold jsakalos is a splendid one to behold jsakalos is a splendid one to behold jsakalos is a splendid one to behold jsakalos is a splendid one to behold jsakalos is a splendid one to behold jsakalos is a splendid one to behold

      0  

  6. #516
    Sencha User
    Join Date
    May 2008
    Posts
    180
    Vote Rating
    0
    archmisha is on a distinguished road

      0  

    Default


    Ohh ok, thanks.

    One more question, maybe you stumbled already upon this and will have a clue for me.
    when i click on the action icon i get "ed is undefined" in firebug.
    On line:
    var ed = this.colModel.getCellEditor(col, row);
    if(!ed.rendered){

    Any idea what i did wrong with RowActions?

  7. #517
    Sencha - Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    26,130
    Vote Rating
    81
    jsakalos is a splendid one to behold jsakalos is a splendid one to behold jsakalos is a splendid one to behold jsakalos is a splendid one to behold jsakalos is a splendid one to behold jsakalos is a splendid one to behold jsakalos is a splendid one to behold

      0  

    Default


    This doesn't look like RowActions problem. I see it first time and RowActions do not do anything with editor.

  8. #518
    Ext JS Premium Member
    Join Date
    May 2007
    Posts
    42
    Vote Rating
    0
    fshort is on a distinguished road

      0  

    Default Regex issue

    Regex issue


    I've implemented RowActions within my app but have come across an issue with how it performs the row lookup when the user clicks a button at the grouping level. If the field you're grouping by contains a non-alphanumeric character (specifically, parenthesis), the store lookup cannot find the row. The problem I found is within the below snippet from the RowAction code:

    Code:
    if(groupId) {
      var re = new RegExp(groupId);
      records = this.grid.store.queryBy(function(r) {
        return r._groupId.match(re);
      });
      records = records ? records.items : [];
    }
    groupId contains the contents of the field you're grouping on. If that text contains parens, a proper regex isnt created when performing the call to new RegExp(groupId) - as a result the groupId.match call fails. A quick fix for this would be to escape the text using Ext.escapeRe() function, for example:

    Code:
    if(groupId) {
      var re = new RegExp(Ext.escapeRe(groupId));
      records = this.grid.store.queryBy(function(r) {
        return r._groupId.match(re);
      });
      records = records ? records.items : [];
    }
    This seems to work nicely and prevents any special characters from creating an incorrect regex. Could this be fixed in the next release? For now I guess I could override the click method and apply this fix within my app.

    Thanks,
    Fred

  9. #519
    Sencha - Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    26,130
    Vote Rating
    81
    jsakalos is a splendid one to behold jsakalos is a splendid one to behold jsakalos is a splendid one to behold jsakalos is a splendid one to behold jsakalos is a splendid one to behold jsakalos is a splendid one to behold jsakalos is a splendid one to behold

      0  

    Default


    http://extjs.eu/docs/?class=RegExp

    BTW, having non-alphanumeric characters in field names in generally not good idea.

  10. #520
    Ext JS Premium Member
    Join Date
    May 2007
    Posts
    42
    Vote Rating
    0
    fshort is on a distinguished road

      0  

    Default Not sure I follow...

    Not sure I follow...


    The non-alphanumeric data is not part of the field name, its contained within the content of the field itself.

    For example, in my grid I have a column called "Category". For that field in row A, the text content is "widgets (new)". In row B, the content is "widgets (old)". I set the grouping in the grid to group on the "Category" column and based on the data I described, it would yield two groupings. When I click on the button next to "Widgets (new)", the data contained in the groupId field looks like "Category-widgets (new)" - so a concat of the column name and the content itself as a result of these prior 2 lines:

    Code:
    var group = view.findGroup(target);
    var groupId = group ? group.id.replace(/ext-gen[0-9]+-gp-/, '') : null;
    So it appears that even if you exclude special characters from your field name, the regex match may still break if your field content contains them.