By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,850 Members | 970 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,850 IT Pros & Developers. It's quick & easy.

Client side script

P: n/a
Hi,

I have a datagrid with several columns and a single column containing a
checkbox. The grid has some client-side javascript and style sheet that
allows rollover change of row color.

I would like to add client-side script that would allow the user to click on
a row to check the checkbox and change the color of that row with performing
a trip back to my web server.

Any suggestions?

Yama
Nov 18 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Sorry I meant without performing a trip back to the web server.

"Yama" <yk*****@stbernard.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Hi,

I have a datagrid with several columns and a single column containing a
checkbox. The grid has some client-side javascript and style sheet that
allows rollover change of row color.

I would like to add client-side script that would allow the user to click on a row to check the checkbox and change the color of that row with performing a trip back to my web server.

Any suggestions?

Yama

Nov 18 '05 #2

P: n/a
you can loop up the parentNode element of the checkbox 'til you hit a
row...something like (not tested)

<input type="checkbox" ...onClick="HighlightRow(this);">

function HighlightRow(checkbox){
if (!checkbox) return;
var parent= null;
for (parent= checkbox.parentNode; parent!= null && parent.TagName !=
'TR';parent= parent.parentNode){}
if (parent != null){
parent.style.background = (checkbox.checked) ? '#ff0000' : '#00ff00';
}
}

Karl

"Yama" <yk*****@stbernard.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Hi,

I have a datagrid with several columns and a single column containing a
checkbox. The grid has some client-side javascript and style sheet that
allows rollover change of row color.

I would like to add client-side script that would allow the user to click on a row to check the checkbox and change the color of that row with performing a trip back to my web server.

Any suggestions?

Yama

Nov 18 '05 #3

P: n/a
Yes this is pretty much what I have. What I am trying to accomplish is when
the user clicks anywhere withing that row I want the behavior to select the
row as well as check the checkbox.

Any other suggestions?

Yama

"Karl" <none> wrote in message news:Ok**************@TK2MSFTNGP09.phx.gbl...
you can loop up the parentNode element of the checkbox 'til you hit a
row...something like (not tested)

<input type="checkbox" ...onClick="HighlightRow(this);">

function HighlightRow(checkbox){
if (!checkbox) return;
var parent= null;
for (parent= checkbox.parentNode; parent!= null && parent.TagName !=
'TR';parent= parent.parentNode){}
if (parent != null){
parent.style.background = (checkbox.checked) ? '#ff0000' : '#00ff00';
}
}

Karl

"Yama" <yk*****@stbernard.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Hi,

I have a datagrid with several columns and a single column containing a
checkbox. The grid has some client-side javascript and style sheet that
allows rollover change of row color.

I would like to add client-side script that would allow the user to
click on
a row to check the checkbox and change the color of that row with

performing
a trip back to my web server.

Any suggestions?

Yama


Nov 18 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.