3.2.0

Alex ... Beta4 problem

Hi Alex,

Beta4 breaks the grid.htm example (\examples\quickref\grid.htm).

The problem appears to be the line:
obj.setEditorTemplate(new AW.UI.Combo, 1);


Is this a bug or do you have updated code for the example? I would like to add a combo box to the grid cell as was done in beta3 in this example.

Thanks,
Rob
Rob Francis
January 22,
Yes I agree, I observed the same behavior, and therefore no template can be set into the grid!!!
JeanLuc
January 23,
yep, same problem with me.
PC
January 24,
It is still possible to apply custom templates in B4 with the technique used in "checkbox-Experiment-1" and resumed here:
(can be use also on single-click)
var lastcelldefaulttemplate;
var lastcol=0;
var lastrow=0;

obj.onCellClicked = function(event, column, row)
{ 
if ( (lastcol + lastrow) != 0)
{	 
obj.setCellTemplate(lastcelldefaulttemplate, lastcol, lastrow);
obj.getCellTemplate(lastcol, lastrow).refresh(); 
 } 
lastcol=0;  
lastrow=0;
 }
    
obj.onCellDoubleClicked = function(event, column, row)
{ 
lastcelldefaulttemplate =  obj.getCellTemplate(column, row);
obj.setCellTemplate(new AW.Templates.Combo, column, row); 
obj.getCellTemplate(column, row).refresh(); 
lastcol=column;
lastrow=row;
}


But I am not sure if Alex is going to remove all :
AW.Templates..... (except ImageText)
Because AW.UI.'s could be used also
Or is there any unknow (new) treatment to archieve this ??
So, Alex please, we need your thoughts again !!!
Thanks


Carlos
January 24,
Uppss ! Sorry ,zeros are valid cells so.. should be:
var lastcelldefaulttemplate; 
var lastcol=null; 
var lastrow=null; 

obj.onCellClicked = function(event, column, row) 
{  
if (lastcol && lastrow)
{      
obj.setCellTemplate(lastcelldefaulttemplate, lastcol, lastrow); 
obj.getCellTemplate(lastcol, lastrow).refresh();  
 }  
lastcol=null;   
lastrow=null; 
 } 
     
obj.onCellDoubleClicked = function(event, column, row) 
{  
lastcelldefaulttemplate =  obj.getCellTemplate(column, row); 
obj.setCellTemplate(new AW.Templates.Combo, column, row);  
obj.getCellTemplate(column, row).refresh();  
lastcol=column; 
lastrow=row; 
}
Carlos
January 24,
The correct use of combo for cell editing should combine cell template (AW.Templates.Combo) and popup template (AW.UI.List) -

var obj = new AW.UI.Grid;

obj.setCellText("cell");
obj.setHeaderText("header");

obj.setColumnCount(10);
obj.setRowCount(1000);

obj.setCellEditable(true);

obj.setCellTemplate(new AW.Templates.Combo, 1);

var list = new AW.UI.List;
list.setItemText("item");
list.setItemCount(5);

obj.setPopupTemplate(list);

document.write(obj);


However this code does not fully work yet in beta4 - will be fixed in the next few days in RC1 release.
Alex (ActiveWidgets)
January 24,
Hello Alex,

This combination does not work in RC1.
The combo box shoes up and spreads down without any problems, but one can not select any values in a dropdown list.

Any clue why is that and what could be a solution?

Paul
Paul
February 6,
Paul,

I don't know why the example above no longer works... however the following one will work in RC1

http://www.activewidgets.com/javascript.forum.11330.1/rc1-example-question-combo-in.html

There are still bugs in the combo in FireFox and the code still indicates that it is not finished.
Rob Francis
February 6,
Alex, will you show us pls the fixes needed to be done in order your example with combo above will work in RC1?

Rob's example is good and fairly too long and messy. And then I have no clue on how to create to columns with combos using Rob's expl. :(

Please...
Paul
February 9,
Paul,

I just tested the example posted by Alex above and it works fine in the final version of 2.0. You are now able to select items from the dropdown in both IE and FF.

Here is the code:

<html>  
<head>  
    <script src="runtime/lib/aw.js"></script>  
    <link href="runtime/styles/xp/aw.css" rel="stylesheet"></link>  
</head>  
<body>  

<script>  

var obj = new AW.UI.Grid; 

obj.setCellText("cell"); 
obj.setHeaderText("header"); 

obj.setColumnCount(10); 
obj.setRowCount(1000); 

obj.setCellEditable(true); 

obj.setCellTemplate(new AW.Templates.Combo, 1); 

var list = new AW.UI.List; 
list.setItemText("item"); 
list.setItemCount(5); 

obj.setPopupTemplate(list); 

document.write(obj); 

</script> 

</body>  
</html>
Rob Francis
February 9,
I have tried this code in IE 7, but the drop down box only shows 3 items in IE while it shows correctly (5 items) in FF. Do you know why ?

Your assistance is appreciated.

Jonathan
<a href="http://www.digitalks.com">digitalks.com</a>
Jonathan Lee
November 29,
Kind of resolved: This will work better in IE:

in webtools/aw/runtime/styles/xp/aw.css

change this:

.aw-list-control {width:400px;height:150px}

to:
.aw-list-control {
width:400px;
height:100%
}

Jonathan Lee
November 29,

This topic is archived.

See also:


Back to support forum