Welcome Guest Search | Active Topics | Sign In | Register

How to add anchor tag <a href="#" in EO.Grid? Options
Raghav Nayak
Posted: Tuesday, September 2, 2008 12:05:32 AM
Rank: Advanced Member
Groups: Member

Joined: 8/21/2008
Posts: 37
Hi,

I've to insert anchor tag column in a EO.Grid. On clicking on this column, a pop up window with the selected details should appear. Please tell me how to add this tag.
If there's no way, then could there be any better way of doing this?

Regards,
Raghav
eo_support
Posted: Tuesday, September 2, 2008 12:37:13 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,093
Raghav Nayak
Posted: Wednesday, September 3, 2008 5:14:53 AM
Rank: Advanced Member
Groups: Member

Joined: 8/21/2008
Posts: 37
Hi,

The above solution is to alert the user. I want to open a new window. Please find below code to be used in the EO.Grid. I had used this code in the datagrid which was working fine.

Code: HTML/ASPX
<a href="#" onclick="MyWindow=window.open('ChildPersonalDetails.aspx?ChildID=<%# DataBinder.Eval(Container.DataItem, "ChildID") %>','MyWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=1000,height=350,left=1, top=1'); return false;">


Thanks & Regards,
Raghav
eo_support
Posted: Wednesday, September 3, 2008 7:23:35 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,093
Hi,

You will not be able to use data binding that way with our Grid. Our Grid works very differently than ASP.NET DataGrid so in generally, you should not expect things that works with ASP.NET DataGrid works with ours. You will want to:

1. Set the Grid's KeyField to "ChildID";
2. Change window.alert in the sample to winow.open just as your onclick handler. Except to replace

Code: HTML/ASPX
<%# DataBinder.Eval(Container.DataItem, "ChildID") %>


With

Code: JavaScript
item.getKey()


So the final code will be something like that:

Code: JavaScript
function OnItemCommand(grid, itemIndex, colIndex, commandName)
{
    var item = grid.getItem(itemIndex);
    window.open('ChildPersonalDetails.aspx?ChildID=' + item.getKey(), .....)
}



Thanks!
Note the above code omitted additional arguments only for demonstration purpose. You should still put them in.

Raghav Nayak
Posted: Thursday, September 4, 2008 11:37:50 PM
Rank: Advanced Member
Groups: Member

Joined: 8/21/2008
Posts: 37
Hi,

It worked!!

Thanks,
Raghav


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.