PDA

View Full Version : Combo box view disable editable in the grid



duleep
25 Nov 2012, 9:48 PM
I have grid look like below

40331

when i want to add new row in to the grid then i click add button that look like below

40332


After add new row in to this grid i want to disable combo box so i did using bellow code


gridRegionsRoweditor.on('beforeedit', function(roweditor, rowIndex){
var record = this.gridRegions.store.getAt(rowIndex);

if(typeof record.data.ROWDATE != 'undefined'){
grdcmbCountry.setDisabled(true);
grdcmbState.setDisabled(true);
return false;
}else{
grdcmbCountry.setDisabled(false);
grdcmbState.setDisabled(false);
}
},this);


above code disable combo box editable but when i double click on cell that show me unclear combo box in that cell as bellow

40333

please help any one how to avoid this unclear combo box after double click in the cell

willigogs
27 Nov 2012, 2:36 AM
Have you tried just returning false without the setDisabled parts?

If returning false on beforeedit, nothing should happen at all...

duleep
27 Nov 2012, 7:10 AM
yes i did, it's look like below. when i try without setDisable that show enable combo box.
40373

willigogs
27 Nov 2012, 7:18 AM
Hmmm, well I would say something isn't working correctly there, since returning false to beforeedit would stop the edit from taking place altogether... :\

e.g.
http://jsfiddle.net/Whinters/Cf7HZ/

Uncomment the //return false; line under the beforeedit listener, and the grid becomes uneditable.

I've never used the roweditor plugin, but could that possibly have additional events which fire after the grid's beforeedit, and therefore overrule your return false returned here?