If I try to select all by marking the select all checkbox the when the position is fixed, the checkboxes does not get marked. See attachment.

The select all for regular view works fine.

Comments

jpoesen’s picture

Status: Active » Postponed (maintainer needs more info)
StatusFileSize
new144.12 KB

unable to reproduce in ff/linux and opera/linux. What do you mean with "when the position is fixed" ?

jrabeemer’s picture

He has the header bar above the table in a fixed location. AFAIK this is non-standard behavior. As the previous screenshot shows, the header is supposed to flow with the content and for me, it currently works in D6 head.

webernet’s picture

Title: Select all does not work » 'Select all' checkbox in floating Tableheader does not work
Component: Garland theme » javascript
Status: Postponed (maintainer needs more info) » Active

I've noticed this too.

asimmonds’s picture

Status: Active » Needs review
StatusFileSize
new3.09 KB

When misc/tableheader.js adds the sticky-header to the page at load time, it copies the html from each header cell to a sticky-header div within the corresponding cell. These copies do not get updated if the original item changes, whether they are a form control or static text.
When the select-all checkbox is clicked, the corresponding select-all checkbox in the sticky-header does not get updated with the current select-all state. Also, the sticky-header checkbox has no event handlers assigned so it effectively doesn't do anything.

You need more than a window's length of table rows to test, so when the page is scrolled down the sticky-header comes into effect.

Attached is a attempt at one way to fix this bug. I've moved the click event handler to the th.select-all cell so the event fires when either of the checkboxes is clicked. Also, added a selectAll() function to update both checkboxes in the th.select-all cell.

This is my first attempt at doing anything with .js or jQuery so it could be not completely correct.

webernet’s picture

The patch appears to be working correctly, but I'll leave it to an expert to decide if it's the right solution.

morphir’s picture

Status: Needs review » Fixed

this works for me now.

webernet’s picture

Status: Fixed » Needs review

This is still an issue. The 'check all' checkbox in the floating tableheader is still not working in head.

anders.fajerson’s picture

I can confirm that the patch fixes the check all in Firefox 2, Opera 9 and IE7, Safari 3 for Windows (IE6 has the tableheader turned off). Lets have some javascript guy review the code as well.

catch’s picture

See also: http://drupal.org/node/184143 which might need considering given chx's arguments.

quicksketch’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new3.03 KB

This is a really interesting solution. I think it's probably the best way to go. Initially looking at it I thought the best approach would be to re-attach behaviors to the new checkbox added. However, running the tableSelect behavior more than once on the same table caused all sorts of trouble.

I included only 2 very minor changes to the patch, both just syntactical things. I renamed the 'selectAll' function to 'updateSelectAll', since it's updating the select all checkbox. Second, I made updateSelectAll() a variable set to an anonymous function, as this is the way all our other functions are defined.

Rather than a much larger change to tableheader.js, I think this approach is best one to take. Nice job asimmonds!

I think this is RTBC, but a second set of testing to make sure I didn't break anything in the changes would be appreciated.

gábor hojtsy’s picture

Status: Reviewed & tested by the community » Needs review

Awaiting a second check. Otherwise the code looks good, so once tested, feel free to RTBC. I don't have too much browsers and platforms to test unfortunately.

webernet’s picture

Status: Needs review » Reviewed & tested by the community

Tested OK.

Thanks quicksketch!

gábor hojtsy’s picture

Status: Reviewed & tested by the community » Fixed

Great, thanks, committed.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.