dhtmlxgrid validation cell

Hi,

I’m trying to validate my grid’s cells, and when one of the cells is not valid,
how can i stay inside the same cell and not move from it (in any way) untill the
value inside the cell becomes valid?

Another question - for some reason when i’m trying to validate the cell with “NotEmpty”,
my cell dosen’t have the red border… is there any known problem for this issue?
(when i’m using “ValidInteger” or any other rule it’s works good).

This is very urgent for me,

Please advice,

Thank’s.

how can i stay inside the same cell and not move from it (in any way) untill the
value inside the cell becomes valid
You can use following code:

grid.attachEvent("onValidationError",fucntion(row_id,cell_ind){ window.setTimeOut(function(){ grid.selectCell(grid.getRowIndex(row_id),cell_ind,false,false,true) },1) });

for some reason when i’m trying to validate the cell with “NotEmpty”, my cell dosen’t have the red border
Unfortunately we cannot reproduce this issue locally. Please check example here dhtmlx.com/docs/products/dht … ation.html
Probably cell red border is overlapped with some other page style

Hi,

Thank’s again for your help,

I tried your code , but now when i’m trying to get out of the cell (which is not valid) ,
the focus moves from that cell to the next cell back and forward without stopping ,
in an Infinite loop… (instead of staying only in the unvalid cell),
How do i fix this?

this is my code in case you need it :

<script>

    mygrid = new dhtmlXGridObject('gridbox');
    mygrid.setImagePath("scripts/dhtmlxGrid/codebase/imgs/");
    mygrid.setHeader("Column A, Column B");
    mygrid.setInitWidths("100,250");
    mygrid.setColAlign("right,left");
    mygrid.setColTypes("ed,ed");
    mygrid.enableValidation(true, true);
    mygrid.setColValidators("NotEmpty,ValidEmail");
    mygrid.setColSorting("int,str");
    mygrid.enableMultiselect(true);     
    mygrid.init();
    mygrid.setSkin("dhx_skyblue");
    mygrid.loadXML("scripts/dhtmlxGrid/samples/common/grid.xml");
    
    mygrid.attachEvent("onValidationError", function(row_id,cell_ind)
    {
        window.setTimeout(function(){mygrid.selectCell(mygrid.getRowIndex(row_id),cell_ind,false,false,true);},1);
    });


</script>

This is very urgent for me,

Please advice,

Thanks.

Try to use “onEditCell” event. When cell editor is closed you will have to validate cell and open cell editor again if entered value is incorrect
docs.dhtmlx.com/doku.php?id=dhtm … oneditcell

I tried to use “onEditCell” event , and when the stage is 2 , if the value is not valid ,
i use the “window.setTimeout(function(){mygrid.selectCell(mygrid.getRowIndex(row_id),cell_ind,false,false,true);},1);” ,

but still it acts in the same way as before, going in to a loop of back and forward between the cell and the next cell.

how can i stay inside the cell without going into that loop?

Please advice , very urgent…

Thanks.

I tried to use “onEditCell” event
It works well in local example. Check if you have removed “onValidationError” event handler