Hi,
I’m using the grid component and also using editable text fields.
In order to have no exceptions on the server side, I need to set max length on those text fields.
Does someone knows how to have this feature?
Thanks!
Hi,
I’m using the grid component and also using editable text fields.
In order to have no exceptions on the server side, I need to set max length on those text fields.
Does someone knows how to have this feature?
Thanks!
You may try to use the onEditCell to create such limit.
Here is the example of the code:
mygrid.attachEvent("onEditCell", function(stage,rId,cInd,nValue,oValue){
if(stage==1 &&mygrid.editor.obj) {
mygrid.editor.obj.onkeypress = function(e){
e = e||window.event;
if((e.keyCode >= 47) || (e.keyCode == 0)){
var text = this.value;
if(text.length >10){ //max length of the text
return false;
}
}
}
}
return true;
});
Was very helpful!
Thank’s!
One more issue regarding this problem.
As I said before, I’ve already managed to fix the problem, but now I have another one due to the changes I made.
In my grid, one of the columns may have a check box which can be clicked and change state, due to the changes, it can be clicked only once, is there any fix which can be done to fix it ?
Issue solved.
The problem was that I overridden the ‘onEditCell’ event again on the grid.
Thanks!