How to capture Columnheader Event
I am Using the follwing Code to display record in Grid. i will select the record by selecting radio button. this code is working fine for if i directly click the radio button. but once i sort the record ,i can't able to get radio button event.i.e grid0.onlcick event. pls help
display_Table('58','<%=view.getSize()%>','0');
grid0.onclick = function ()
{
myGridClick();
}
function myGridClick()
{
var radioItem = document.getElementsByTagName("input");
var itemCount = radioItem.length;
for (i=0; i<itemCount; i++)
{
if(radioItem[i].name != undefined && radioItem[i].name=="rdoSelect" && radioItem[i].checked)
{
selFlag = true;
break;
}
}
if(selFlag == true)
{
var btnItem = document.getElementById("btnOK");
btnItem.className = "bbutton";
}
}
function display_Table(colcount,rowcount,num)
{
var obj1 = display_Table_Rewrite(colcount,rowcount,num,"Y");
document.write(obj1);
}
function display_Table_Rewrite(colcount,rowcount,num,isSort){
// create ActiveWidgets Grid javascript object
var obj1 = new Active.Controls.Grid;
//obj1.setId(eval("grid"+num))
obj1.setId("grid"+num);
// set number of rows/columns
obj1.setRowProperty("count",parseInt(rowcount));
obj1.setColumnProperty("count",parseInt(colcount));
// provide cells and headers text
var gheight='';
if ((screen.width == 1280) && (screen.height == 1024)){
gheight=18;
}else{
gheight=15;
}
obj1.setDataProperty("text", function(i, j){return eval("myData"+num+"[i][j]")+"<img src='spacer.gif' height='"+gheight+"' width='2px' > </img>"});
obj1.setColumnProperty("text", function(i){return eval("myColumns"+num+"[i]")});
obj1.setColumnHeaderHeight(getColumnHeaderHeight());
obj1.setRowHeaderWidth("00px");
var alternate = function(){
return this.getProperty("row/order") % 2 ? "#ffffff" : "#ffffff";
}
var row = new Active.Templates.Row;
row.setStyle("background", alternate);
// to change the row height by david
row.setStyle("height", getRowHeight());
obj1.setTemplate("row", row);
//need sort or not
if(isSort == 'N'){
obj1.getTemplate("top/item").setEvent("onmousedown", null);
}
if(isSort == 'Y'){
obj1.sort();
}
return obj1;
}
display_Table('58','<%=view.getSize()%>','0');
grid0.onclick = function ()
{
myGridClick();
}
function myGridClick()
{
var radioItem = document.getElementsByTagName("input");
var itemCount = radioItem.length;
for (i=0; i<itemCount; i++)
{
if(radioItem[i].name != undefined && radioItem[i].name=="rdoSelect" && radioItem[i].checked)
{
selFlag = true;
break;
}
}
if(selFlag == true)
{
var btnItem = document.getElementById("btnOK");
btnItem.className = "bbutton";
}
}
function display_Table(colcount,rowcount,num)
{
var obj1 = display_Table_Rewrite(colcount,rowcount,num,"Y");
document.write(obj1);
}
function display_Table_Rewrite(colcount,rowcount,num,isSort){
// create ActiveWidgets Grid javascript object
var obj1 = new Active.Controls.Grid;
//obj1.setId(eval("grid"+num))
obj1.setId("grid"+num);
// set number of rows/columns
obj1.setRowProperty("count",parseInt(rowcount));
obj1.setColumnProperty("count",parseInt(colcount));
// provide cells and headers text
var gheight='';
if ((screen.width == 1280) && (screen.height == 1024)){
gheight=18;
}else{
gheight=15;
}
obj1.setDataProperty("text", function(i, j){return eval("myData"+num+"[i][j]")+"<img src='spacer.gif' height='"+gheight+"' width='2px' > </img>"});
obj1.setColumnProperty("text", function(i){return eval("myColumns"+num+"[i]")});
obj1.setColumnHeaderHeight(getColumnHeaderHeight());
obj1.setRowHeaderWidth("00px");
var alternate = function(){
return this.getProperty("row/order") % 2 ? "#ffffff" : "#ffffff";
}
var row = new Active.Templates.Row;
row.setStyle("background", alternate);
// to change the row height by david
row.setStyle("height", getRowHeight());
obj1.setTemplate("row", row);
//need sort or not
if(isSort == 'N'){
obj1.getTemplate("top/item").setEvent("onmousedown", null);
}
if(isSort == 'Y'){
obj1.sort();
}
return obj1;
}
Javadeveloper
June 19,