|
|
|
start date: Mon, 20 Aug 2007 02:22:02 -0700,
posted on: microsoft.public.dotnet.framework.aspnet
back
| Thread Index |
|
1
Alhambra Eidos Kiquenet
|
|
2
Eliyahu Goldin
|
|
3
Ladislav Mrnka
|
Select Row by javascript in Datalist
Hi misters,
I have Datalist like this:
....
<HeaderTemplate>
<table cellpadding="0" cellspacing="0" id="tbl"><tbody>
</HeaderTemplate>
<ItemTemplate>
<tr id="<%# "filaListado" + Eval("idtareasworkflow") %>"
onclick="SelectRow('<%# Eval("idtareasworkflow") %>', <%# "'" +
Eval("Offset") + "'" %>);"
<%# EstiloFilaJavaScript(Container) %>
class="<%# Container.ItemIndex % 2 == 0 ? "ItemStyle" :
"AlternatingItemStyle" %>"
....
Now, it want to access to Row of Item Template. I put attribute runat=server.
I can't bind to ID property if it's runat=server, isn't?
I have this code, now:
<tr id="rowDatalist"
runat="server"
onclick="SelectRow ????"
How I implement my javascript function SelectRow ? Which parameters of js
function ? I want to access to row, but the id of TR is dynamic, isn't? It
would be neccesary something like similar ClientID.
any help for me? I will be grateful for any comments, help...
Thanks in advance, regards, greetings.
--
http://www.alhambra-eidos.es/web2005/index.html
www.kiquenet.net
www.trabajobasura.com/solusoft
Date:Mon, 20 Aug 2007 02:22:02 -0700
Author:
|
Re: Select Row by javascript in Datalist
function selectRow(row){
// do here what you need, for example set a css style for the row background
}
<tr onclick="selectRow (this)">
--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"Alhambra Eidos Kiquenet"
wrote in message news:E0442B76-AD56-4DD6-9E78-DA4A851EE77B@microsoft.com...
> Hi misters,
>
> I have Datalist like this:
>
> ...
> <HeaderTemplate>
> <table cellpadding="0" cellspacing="0" id="tbl"><tbody>
> </HeaderTemplate>
> <ItemTemplate>
>
> <tr id="<%# "filaListado" + Eval("idtareasworkflow") %>"
> onclick="SelectRow('<%# Eval("idtareasworkflow") %>', <%# "'" +
> Eval("Offset") + "'" %>);"
> <%# EstiloFilaJavaScript(Container) %>
> class="<%# Container.ItemIndex % 2 == 0 ? "ItemStyle" :
> "AlternatingItemStyle" %>"
> ...
>
> Now, it want to access to Row of Item Template. I put attribute
> runat=server.
>
> I can't bind to ID property if it's runat=server, isn't?
>
> I have this code, now:
>
> <tr id="rowDatalist"
> runat="server"
> onclick="SelectRow ????"
>
> How I implement my javascript function SelectRow ? Which parameters of js
> function ? I want to access to row, but the id of TR is dynamic, isn't? It
> would be neccesary something like similar ClientID.
>
> any help for me? I will be grateful for any comments, help...
>
> Thanks in advance, regards, greetings.
>
> --
> http://www.alhambra-eidos.es/web2005/index.html
> www.kiquenet.net
> www.trabajobasura.com/solusoft
>
Date:Mon, 20 Aug 2007 12:56:03 +0300
Author:
|
RE: Select Row by javascript in Datalist
Hi,
I think you are using wrong component to achieve your requirements. You are
trying to render html table at your own, but DataList also renders its
content to html table. That means result of your page will not be HTML valid.
It will look like:
<table>
<tr>
<td>
<!-- here will be your header template -->
<table cellpadding="0" cellspacing="0" id="tbl"><tbody>
</td>
</tr>
<tr>
<td>
<!-- here will be your first item -->
<td>
...
</td>
</td>
</tr>
etc.
If you want to control table rendering at your own you have to use Repeater
control.
Regards,
Ladislav
"Alhambra Eidos Kiquenet" wrote:
> Hi misters,
>
> I have Datalist like this:
>
> ...
> <HeaderTemplate>
> <table cellpadding="0" cellspacing="0" id="tbl"><tbody>
> </HeaderTemplate>
> <ItemTemplate>
>
> <tr id="<%# "filaListado" + Eval("idtareasworkflow") %>"
> onclick="SelectRow('<%# Eval("idtareasworkflow") %>', <%# "'" +
> Eval("Offset") + "'" %>);"
> <%# EstiloFilaJavaScript(Container) %>
> class="<%# Container.ItemIndex % 2 == 0 ? "ItemStyle" :
> "AlternatingItemStyle" %>"
> ...
>
> Now, it want to access to Row of Item Template. I put attribute runat=server.
>
> I can't bind to ID property if it's runat=server, isn't?
>
> I have this code, now:
>
> <tr id="rowDatalist"
> runat="server"
> onclick="SelectRow ????"
>
> How I implement my javascript function SelectRow ? Which parameters of js
> function ? I want to access to row, but the id of TR is dynamic, isn't? It
> would be neccesary something like similar ClientID.
>
> any help for me? I will be grateful for any comments, help...
>
> Thanks in advance, regards, greetings.
>
> --
> http://www.alhambra-eidos.es/web2005/index.html
> www.kiquenet.net
> www.trabajobasura.com/solusoft
>
Date:Mon, 20 Aug 2007 07:04:07 -0700
Author:
|
|
|