Menu

Table Header Cell Issues

Help
2008-05-21
2012-10-09
  • Rory Slegtenhorst

    Hi,

    In my webapp I use the DisplayTag/AjaxTags extensivly, and with a lot of pleasure I might add.

    I was building some "filter" thingy that could be inserted inside the headercell...
    I have been messing around with the title, but find myself now in a situation I can't get out of.

    Currently, the generated headercell looks something like:
    <th class="sortable .."><a href="...">Title</a></th>

    My plan is to add some dropdown thingy in there...
    <th class="sortable .."><a href="...">Title</a><select><option>..</option>...</select></th>

    But when using the title property of display:column, the dropdownbox becomes part of the <a ..> tag.
    Thus, when I try to select an item, it will also generate a onclick even on the header cell, causing it to sort.
    <th class="sortable .."><a href="...">Title<select><option>..</option>...</select></a></th>

    I remain here with two questions:

    1. Is it possible to add an "id" property to the <th ..> tag?
      If so, I could then use ajax or something to add my dropdown to the th tag...

    2. if 1 isn't possible, then how can I remove a "descendent" onclick handler?
      Eg how could I make the <select ..> tag be clickable without executing the <a ..> tags link?

    Thanks for any help...
    Rory

     
    • wecansolveit.org

      Could you post your code in a little detail please. I am working on a similar thing and may be I could learn something and also possible try to comment on your code.

       

Log in to post a comment.