PDA

View Full Version : Issue with getRowClass in firefox and IE



varunjyoti
7 Aug 2012, 5:53 AM
I have a grid in which i want to hide some specific rows which i am doing it by


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.

friend
7 Aug 2012, 9:33 AM
As an alternative, you could use the built-in filtering mechanism of an Ext.data.Store, e.g. filter() (http://docs.sencha.com/ext-js/4-1/#!/api/Ext.data.Store-method-filter) and filterBy() (http://docs.sencha.com/ext-js/4-1/#!/api/Ext.data.Store-method-filterBy). It looks like filter() would easily meet your needs.

amitkumarchauhan
14 Oct 2012, 10:27 PM
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??

varunjyoti
15 Oct 2012, 1:27 AM
Write the getRowClass function inside initComponent



initComponent: function () {
var me = this;
me.callParent(arguments);
me.getView().getRowClass = function(record, rowIndex, rowParams, store) {
............
}
};



This solved the problem for me.

amitkumarchauhan
15 Oct 2012, 1:34 AM
thanks varun it worked.