Closed (fixed)
Project:
Drupal core
Version:
6.x-dev
Component:
javascript
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
25 Jun 2007 at 22:06 UTC
Updated:
28 Nov 2007 at 21:31 UTC
Jump to comment: Most recent file
Comments
Comment #1
jpoesen commentedunable to reproduce in ff/linux and opera/linux. What do you mean with "when the position is fixed" ?
Comment #2
jrabeemer commentedHe 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.
Comment #3
webernet commentedI've noticed this too.
Comment #4
asimmonds commentedWhen 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.
Comment #5
webernet commentedThe patch appears to be working correctly, but I'll leave it to an expert to decide if it's the right solution.
Comment #6
morphir commentedthis works for me now.
Comment #7
webernet commentedThis is still an issue. The 'check all' checkbox in the floating tableheader is still not working in head.
Comment #8
anders.fajerson commentedI 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.
Comment #9
catchSee also: http://drupal.org/node/184143 which might need considering given chx's arguments.
Comment #10
quicksketchThis 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.
Comment #11
gábor hojtsyAwaiting 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.
Comment #12
webernet commentedTested OK.
Thanks quicksketch!
Comment #13
gábor hojtsyGreat, thanks, committed.
Comment #14
(not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.