Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by andreea on May 15, 2008 05:36
open dhtmlx forum
i want to make the "class=col_highlight" of a cell active only after another cell equals "between"

i have a grid with the following xml

- <rows id="0">
- <row id="96" open="1">
<cell>1</cell>
<cell image="books.gif">Environment</cell>
<cell />
- <row id="attrib2" open="1">
<cell>1</cell>
<cell image="red.gif">Water debit(EN)</cell>
<cell class="col_highlight">1</cell>
</row>
.........


i want to put the "class=col_highlight" in a cell , only after the user edits a cell (on teh web page ) and gives the value "between"
Answer posted by Support on May 15, 2008 05:45

You can use complex css rules to enable|disable active ones, and onEditCell event to catch moment when rules need to be changed

 

<style>
 .rule_active .col_highlight{
      background-color:red;
}
</style>

....

grid.attachEvent("onEditCell",function(stage,id,ind,value){
        if (stage = 2 && value=="between") grid.entBox.className+=" rule_active";
        return true;
});

as result, css rule will be applied only after some value in grid will be edit to "between"