3.2.0

Change Cell image from combo selection

I am trying to update the image in the cell based on a combo selection.
Everything seems to work except that when the object is refreshed it causes the values to go back to the original values, both image and text.
not sure why but it seems like onCellTextChanged is being run after the refresh function.

here is the code for the list and combo:
var arrow_text='<?php echo implode(",",$a_arrow_labels); ?>';
    arrow_text=arrow_text.split(",");
    //alert(arrow_text);
    
    var arrow_value='<?php echo implode(",",$a_arrow_values); ?>';
    arrow_value=arrow_value.split(",");
    //alert(arrow_value);
    var arrow_css='<?php echo implode(",",$a_arrow_css); ?>';
    arrow_css=arrow_css.split(",");
    //alert(arrow_css)

    var arrow_list = new AW.UI.List;
    arrow_list.setItemText(arrow_text);//arrow_text is built in mine.php based on sql.
    arrow_list.setItemValue(arrow_value);
    arrow_list.setItemImage(arrow_css);
    arrow_list.setItemCount(arrow_text.length);

function arrowpic(col, row){
        for(i=0;i<arrow_text.length;i++){
        	if(obj2.getCellValue(1,row)==arrow_text[i]){
        		return arrow_css[i];
        	}
        }
    }

    ArrowCombo = new AW.Templates.Combo;
    obj2.setCellTemplate(ArrowCombo, 1);
    obj2.setPopupTemplate(arrow_list, 1);


And here is the onCellTextChanged code:

obj2.onCellTextChanged = function(text, column, row){
        if(column==1){
            try{
                for(i=0;i<arrow_text.length;i++){
                    if(text==arrow_text[i]){
                        updateVC(row,column,arrow_value[i],obj2); //arrow_value is defined in mine.php
                        for(i=0;i<arrow_text.length;i++){
                            if(text==arrow_text[i]){
                                obj2.setCellImage(arrow_css[i],1,row);
                                table2.getNode(column, row).textContent=text;
                                obj2.getCellTemplate(column,row).refresh(); 
                                obj2.getCellTemplate(column,row).element().focus(); 
                                //this.setCellData(text, column, row);
    							//this.setCellText(undefined, column, row); 
                                //obj2.refresh();
                            }
                        }
                    }
                }
            }
            catch(e){alert(e)}
        }
    }


As you can see from the commented code I have tried a number of different things. I am greatful for any ideas.
HoseHead
November 27,

This topic is archived.

See also:


Back to support forum