PDA

View Full Version : Extjs grid panel row disable (NON SELECTABLE)



javapurna
21 Oct 2013, 8:38 PM
hi every one,

how to disable grid panel single row disable(non selectable) . in my case grid display all employees . in grid my logged in employee also displayed(logged in employee id is globale setting, where ever i want i am using).

i want to display logged in employee in first row and disable the row .

46466

Piruthu
21 Oct 2013, 9:00 PM
listen for beforeselect and return false if the index is zero (in your case)


listeners: {
beforeselect :{
fn: function( grid, record, index, eOpts ){
if (index == 0) return false;
}
}
}

javapurna
22 Oct 2013, 5:02 AM
thanks for replay Piruthu (http://www.sencha.com/forum/member.php?192231-Piruthu),
it is use full for me.
but i want to display record in index=0(ie: if logged in employee id =record id)
here is my code


viewConfig: {
getRowClass: function(record, rowIndex, rowParams, store){
if(record.data.employeeUuid==loggedInEmployeeUUID){
// move record to grid first row . checkbox selected,after checkbox non deselectable
}
}
},

Piruthu
22 Oct 2013, 9:52 PM
not sure of using 'getRowClass' for that purpose. Any way you could try removeAt and insert methods of store
o (http://docs.sencha.com/extjs/4.1.1/#!/api/Ext.data.Store)r try using sorters for that purpose like the sample here
143

javapurna
25 Oct 2013, 4:03 AM
thank you very much