:: Forum >> Version 2 >>

How to pass the Input Text to Cell Text

Well I am obviously making something wrong, but I am lost a bit and time is pressing me to find sollution... So perhaps I am gonna find some help here... ;-)

I am trying to make a form, to select MySQL columns to be rendered in some Report. I made a grid, that is filled with mysql_fetch_field (PHP) function and added a combo with filtering options ("do not show","=","<",">: etc.). If there is set any other option than "do not show" the next column is changed to input to get the value for filtering.

The point is, that in my example, everything works fine, but the value stored in input field is lost on any operation calling grid.refresh() aka sort etc. I tried to use onControlEditEnded event to set cellText to the value of inputs controlText, but it does not work :(

Here is my code:

gridReportTables.setPopupTemplate(function(colrow) {
        var 
grid this;
        var list = new 
AW.UI.List;
    
        list.
setItemText(["Do not show","equals""is higher than""is less than","is higher or equals","is less or equals","is between"]);
        list.
setItemValue([0,123456]);
        list.
setItemCount(7);
    
        for (
0< list.getItemCount(); i++) {
        if (
grid.getCellValue(colrow) == list.getItemValue(i)) {
            list.
setSelectedItems([i]);
                break;
            }
        }
    
        list.
onItemClicked = function(eventi){
            var 
text this.getItemText(i);
            var 
value this.getItemValue(i);
            
grid.setCellText(textcolrow);
            
grid.setCellValue(valuecolrow);
            
grid.getCellTemplate(colrow).hidePopup();
            
            var 
defaultcelltemplate grid.getCellTemplate(0,0); 
            var 
CellEdit = new AW.UI.Input;
                
CellEdit.onControlEditEnded = function(colrow)
                {
                    
alert(CellEdit.getControlText());
                    
grid.setCellTextthis.getControlText(), colrow);
                    
grid.setCellValuethis.getControlValue(), colrow);
                }
            if(
value && value 6)
            {
                
                
grid.setCellTemplate(CellEdit14row);
                
grid.setCellTemplate(defaultcelltemplate15,row); 
                
                
grid.refresh();
            }
            else if(
value == 6)
            {
                
grid.setCellTemplate(CellEdit14,row); 
                
grid.setCellTemplate(CellEdit15,row);
                
                
grid.refresh();
            }
            else if(
value == 0)
            {
                
grid.setCellTemplate(defaultcelltemplate14,row); 
                
grid.setCellTemplate(defaultcelltemplate15,row);
                
                
grid.refresh();
            }
        }
        return list;
    });
 
TO ALEX: Is it because I call the setTemplate form within othe object and set the input behaviour and properities within that object ?
ASJ
Monday, October 16, 2006
BUMP :(
ASJ
Monday, October 16, 2006



This topic is archived.

Back to support forum

Forum search