:: Forum >> Version 1 >>

Highlight textbox text

Hi all,

I tried to put a textbox in the grid, but some reason, I cannot hightlight the text in the textbox. I have serached this forum and the reference, but I still cannot find anything related to this problem. Can anybody give me some direction?

Thanks
Welles

<style>
    
#grid01 {height200pxborder2px insetbackgroundwhite}
    
#grid01 {width400pxborder2px insetbackgroundwhite}
    
#grid01 .active-scroll-top, .active-scroll-corner {height25px}
    
#grid01 .active-scroll-left, .active-scroll-data {padding-top25px}
    
#grid01 .active-grid-column {border-right1px solid threedlightshadow;}
    
#grid01 .active-grid-row {height25px}
    
#grid01 .active-scroll-left .active-list-item {height25px}
    
#grid01 .active-column-{width200pxtext-alignleft;}
</
style>

<
script>
    var 
myColumns01 = [ "textbox" ];
    var 
myData01 = [["<input type=\"text\" name=\"orderlineViewPage[0].qty\" maxlength=\"60\" size=\"10\" value=\"test text\">",]];

    
rowCount01=1;
    
colNum01=1;

    
//    create ActiveWidgets Grid javascript object
    
var gridObj01 = new Active.Controls.Grid;
    
gridObj01.setId("grid01");
    
gridObj01.setStyle("font-size""9pt");

    
//    set number of rows/columns

    
gridObj01.setRowCount(rowCount01);
    
gridObj01.setColumnCount(colNum01);
    
gridObj01.setDataText(function(ij){return myData01[i][j]});
    
gridObj01.setColumnText(function(i){return myColumns01[i]});

    
//    set click action handler
    
gridObj01.setAction("click", function(src){window.status src.getProperty("item/text")});

    var 
substart 1;

    
gridObj01.setRowText(function(i){return substart i});

    var 
alternate = function(){
        return 
this.getProperty("row/order") % 2 ? "#EEEEEE" "white";
    }

    var 
row01 = new Active.Templates.Row;

    
row01.setStyle("background"alternate);

    
gridObj01.setTemplate("row"row01);

    
//    write grid html to the page
    
document.write(gridObj01);
</
script>

 
Welles
Wednesday, April 13, 2005
I just found the soluciton! So, I am answering my quesiton here.

For some reason, the highlighting is disabled in a cell. To enable it, go to the grid.js file in the libaray. Search "onselectstart" and change the value from false to ture.

Welles
Welles
Monday, April 18, 2005



This topic is archived.

Back to support forum

Forum search