Results 1 to 5 of 5

Thread: Issue with getRowClass in firefox and IE

  1. #1
    Sencha User
    Join Date
    Nov 2011
    Posts
    60
    Vote Rating
    0
      0  

    Default Issue with getRowClass in firefox and IE

    I have a grid in which i want to hide some specific rows which i am doing it by
    Code:
    viewConfig: {
            getRowClass: function (record, index) {
                var rec = record.get('prodname');
                 if (rec.toLowerCase().indexOf("admin") != -1) {
                    return 'hidden-row';    
                }
                
            }        
        },
    This is working in chrome but not in Firefox and IE. I am using 4.0.5 version. In firefox and IE, "getRowClass" function is not even called. means if i put an alert inside this function, alert wont show up.

    Why it isn't working in firefox and IE. Also, If there is some other way to hide the rows, please suggest.

  2. #2
    Sencha User friend's Avatar
    Join Date
    Apr 2011
    Posts
    895
    Answers
    106
    Vote Rating
    27
      0  

    Default

    As an alternative, you could use the built-in filtering mechanism of an Ext.data.Store, e.g. filter() and filterBy(). It looks like filter() would easily meet your needs.

  3. #3
    Sencha User
    Join Date
    Aug 2011
    Location
    india
    Posts
    52
    Vote Rating
    0
      0  

    Default

    I have the same issue including chrome and I want to use the viewConfig only..since the function will be called at loading time only and not after that...can any one help me...please??

  4. #4
    Sencha User
    Join Date
    Nov 2011
    Posts
    60
    Vote Rating
    0
      0  

    Default

    Write the getRowClass function inside initComponent

    Code:
    initComponent: function () {
            var me = this;
            me.callParent(arguments);
            me.getView().getRowClass = function(record, rowIndex, rowParams, store) {
                  ............
             }
      };
    This solved the problem for me.

  5. #5
    Sencha User
    Join Date
    Aug 2011
    Location
    india
    Posts
    52
    Vote Rating
    0
      0  

    Default

    thanks varun it worked.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •