Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Rachel Santamaría on Dec 09, 2009 08:52
open dhtmlx forum
option new or not of combo in grid

Hello!

I have a grid with one cell type "combo" laoded by XML.

------
<column align='left' width='150' sort='na' type='combo' filter='true' xmlcontent='1'>Servicio
    <option value='1'>CON</option>
    <option value='3'>FOR</option>
    <option value='4'>LAB</option>
    </column>
----

In action, I write "asdf" in this cell and, it not exists in the xml, but it is correct.

How can I know if the value of this cell is in the list (1 = "CON", 3 = "FOR", 4 = "LAB")???

Bye!
Answer posted by Alex (support) on Dec 10, 2009 02:23

Hello,

in this case you can use onEditCell event. For example:

grid.attachEvent("onEditCell",function(stage,rowId,cellIndex,newValue,oldValue){

    if(stage ==2 && cellIndex==index){

        var combo = grid.getColumnCombo(index);

        if(combo.getIndexByValue(newValue)==-1) alert("this value doesn't exist in the xml") ;

    }
    return true

})

Here index is an index of the "Servicio" column.


Answer posted by Rachel Santamaría on Dec 10, 2009 04:28

Thanks!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

 

This solution is perfect!