:: Forum >>

input box inside grid cel in 2.0.1 acts different from 2.0.0

Hi,

I had some code that worked in 2.0.0 to place an input box inside a grid cel. It might not be the "right" way to do it, but it seemed to work but now in 2.0.1 what happens is that when you type into the input box you can't see what is typed in, i.e. it's invisible. Even the icon that was set with setControlImage() disappears as soon as you start typing in the box. I'm using this with Firefox 1.5.0.4.

Here's basically how I set it up (below). If there is a more correct way to do this I'd be happy to know about it, otherwise any clues as to why this might be happening?

var grid = new AW.UI.Grid;
grid.setHeaderText(["header"]);
var myInput = new AW.UI.Input;
myInput.setControlText(initialText);
myInput.setControlImage("search");
grid.setCellText([[ myInput.toString() ]]);
grid.setColumnCount(1);
grid.setRowCount(1);

Again, this worked in 2.0.0, and some of it is almost working now, it's just that the cel in question gets "blanked out" once I start typing into it. I can tell by the rest of my setup that the text I type in actually does "stick" in the input box, I just cant see it as I'm typing it or after I've typed it...

Thanks for any help that can be provided

at
Friday, June 23, 2006
try
<script>
var initialText = 'lol';
var grid = new AW.UI.Grid;
grid.setHeaderText(["header"]);
grid.setColumnCount(1);
var input = new AW.UI.Input;
input.setControlImage("search");
input.setControlText(initialText);
grid.setCellTemplate(input, 0);
grid.setRowCount(2);
document.write(grid);
</script>
Paulo Cesar Silva Reis (PC from Brazil).
Friday, June 23, 2006
Paulo,

Muito obrigado. This gets me closer to a working solution and I can see the typed-in text. Now I have another problem which has to do with a piece of the puzzle I didn't discuss above... in my original code, I have the following

myInput.onControlEditEnded = function(text){ ... };

Even with my original problem posted above, this function would be properly invoked when the user edits the box (although the text was completely invisible as I described). With the setCellTemplate() solution you've suggested, I can see my text but it seems that my "edit ended" callback doesn't get invoked... any ideas? Here's my current code:

var initialText = 'lol';
var grid = new AW.UI.Grid;
grid.setHeaderText(["header"]);
grid.setColumnCount(1);
var input = new AW.UI.Input;
input.setControlImage("search");
input.setControlText(initialText);
input.onControlEditEnded = function(text) { ..I wish this would be reached but now it's not.. };
grid.setCellTemplate(input, 0);
grid.setRowCount(2);

Also, is there any significance to setting row count to 2 instead of 1?

Thanks a lot
at
Friday, June 23, 2006
hi..
take a look in http://www.activewidgets.com/aw.ui.grid/cell-edit-events.html

I think, u can use:
grid.onCellEditEnded = function(text, column, row){
if(column == 0) { // your input field column
alert(text);
}
};
Paulo Cesar Silva Reis (PC from Brazil).
Friday, June 23, 2006
Hi at and Paulo,

I need some help with initializing a grid with editable text input fields (as described above).

Is it possible to set the initial value of the text input box using setCellText()? This would be very convenient since I already have all the data in the 2D array.

var myData = [
["A col1 data", "A col2 data"],
["B col1 data", "B col2 data"],
]

grid.setCellText(myData);

Thanks in advance,
Michael
Monday, June 26, 2006
hi, take a look in

http://activewidgets.com/javascript.forum.11782.7/setcelltext-method-used-can-cause.html.
Paulo Cesar Silva Reis (PC from Brazil)
Tuesday, June 27, 2006

This topic is archived.


Back to support forum

Forum search