Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Edgardo on Apr 17, 2008 14:12
open dhtmlx forum
Using findcell to search for empty cells

Hello,

Im trying to do a verification on the grid before send it using FORM integration. There is a way to use findcell into some columns to verify is some cells are empty (string or numeric)?

Thank you!
Answer posted by Support on Apr 18, 2008 02:07
Sure, you can use next syntax
    var res=grid.findCell("",index);
    for (var a=o; a<res.length; a++)
       alert("empty cell at row "+res[a][0]);

where index - index of column in question
Answer posted by Edgardo on Apr 18, 2008 06:17

I tried your code. The problem is , that code give me all the cells on the column. That not search for empty cells, instead, give all cells on the column. Please, try the code and give me a solution, Thank you!

Answer posted by Support on Apr 18, 2008 07:53
Sorry for inconvenience, the previous sample really was not correct ( because findCell searchs for occurrences and not for exact match )

You can use next approach

function check () {
    mygrid.forEachRow(function(id){
        if (mygrid.cells(id,1).getValue()=="")
            alert("cell at row "+id+" is empty");
    })
}
Attachments (1)
Answer posted by Edgardo on Apr 18, 2008 07:37
Thank you for your support!