You can use JavaScript to walk the tree of elements that the table
creates and add whatever logic you lik.
Here's an example using the Prototype library to simplify some things:
<script type="text/javascript">
ajaxAnywhere.getZonesToReaload = function() { return "userTable" }
ajaxAnywhere.onAfterResponseProcessing = function() { replaceLinks() }
function replaceLinks() {
// replace all the links in <thead> with onclick's that call
AjaxAnywhere
var sortLinks = $('userList').getElementsByTagName('thead')[0]
.getElementsByTagName('a');
ajaxifyLinks(sortLinks);
if (document.getElementsByClassName('pagelinks').length > 0) {
var pagelinks = document.getElementsByClassName('pagelinks')[0]
.getElementsByTagName('a');
ajaxifyLinks(pagelinks);
}
//highlightTableRows("userList");
var editable = document.getElementsByClassName('editable');
for (i=0; i < editable.length; i++) {
var userId =
editable[i].parentNode.parentNode.getElementsByTagName("a")[0].innerHTML;
new Ajax.InPlaceEditor(editable[i].id, 'users.html?id=' + userId);
}
}
function ajaxifyLinks(links) {
for (i=0; i < links.length; i++) {
links[i].onclick = function() {
ajaxAnywhere.getAJAX(this.href);
return false;
}
}
}
replaceLinks();
</script>
On 10/12/05, Lara Taylor <[EMAIL PROTECTED]> wrote:
>
> Hello,
> I'm using the displaytag lib for the paging feature. I also need to use
> the dynamic linking. Both features are working. However, I need the url to
> open in another browser window. A couple of things would be helpful:
>
> 1) a way to add an onClick event to a column
>
> 2) a way to target the href attribute
>
> Is there currently a way to do this? I've spent a lot of time trying
> different ways to make this work.
>
> Ideally, I want to call a javascript to open a new window and configure it
> without scrollbars, etc. Is there a way to do this with the current tag
> library?
>
> Thanks for any help,
> Lara Taylor
> Jefferson County IT
> [EMAIL PROTECTED]
>
-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
displaytag-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/displaytag-user