Deprecated: Function set_magic_quotes_runtime() is deprecated in /home4/mfoster/public_html/cb/forums/include/common.php on line 62

Warning: Cannot modify header information - headers already sent by (output started at /home4/mfoster/public_html/cb/forums/include/common.php:62) in /home4/mfoster/public_html/cb/forums/header.php on line 31

Warning: Cannot modify header information - headers already sent by (output started at /home4/mfoster/public_html/cb/forums/include/common.php:62) in /home4/mfoster/public_html/cb/forums/header.php on line 32

Warning: Cannot modify header information - headers already sent by (output started at /home4/mfoster/public_html/cb/forums/include/common.php:62) in /home4/mfoster/public_html/cb/forums/header.php on line 33

Warning: Cannot modify header information - headers already sent by (output started at /home4/mfoster/public_html/cb/forums/include/common.php:62) in /home4/mfoster/public_html/cb/forums/header.php on line 34
Cross-Browser.com / xTableHeaderFixed & AJAX

Cross-Browser.com

X Library Forums

You are not logged in.

Announcement

New user registration is currently disabled.

#1 May 5, 2011 1:10:40 pm

infringer
New Member
Registered: May 5, 2011
Posts: 2

xTableHeaderFixed & AJAX

I found your script while trying to find a way to have a fixed header, now that Firefox 4 has disabled the scrolling tbody.

The script works.  However I noticed one flaw, it even works on your demo pages.

http://cross-browser.com/x/examples/xthf-ajax.php

when you replace the contents of the div, with something other than a xthf table.  The old header stays visible.  Stuck in the way.

I'm using firebug for the testing.

test = xGetElementById('demo-ajax-container'); test.innerHTML = '';

or you could paste this in the address bar: javascript:test = document.getElementById('demo-ajax-container'); test.innerHTML = '';void(0);

When you blank the div, the old header stays visible.  Same thing if you put content other than a table into the div?

Is there any way you can think of to fix this?  I thought about observing the div for changes and searching for the table classname, then trying to remove the copy of the old header the script creates?

Seems to consistently do it with Table 2, but i have gotten it to stick with table 1 or 3 as well.  It always sticks with my application.

Thanks,
-David

Offline

 

#2 May 5, 2011 3:07:22 pm

MikeFoster
Administrator
From: Alabama, USA
Registered: April 27, 2007
Posts: 874
Website

Re: xTableHeaderFixed & AJAX

Hi infringer, Welcome to the forums!

I'm experimenting with this object now for shutter's question on zoom support, so I'll take a look at this while I'm doing that. I think we just need to be able to call _dtor to let the object clean itself up. However, that method is "private", so I'll just implement a public method for it. For example...

  this.clean = function()
  {
    _dtor();
  };


Then you would need to call the clean method before replacing the contents of its container via innerHTML.

Would that work for you? I'll get it uploaded here soon so you can give it a try.

Offline

 

#3 May 5, 2011 3:22:39 pm

MikeFoster
Administrator
From: Alabama, USA
Registered: April 27, 2007
Posts: 874
Website

Re: xTableHeaderFixed & AJAX

I've made the change - it is rev12. You can copy the rev12 code from here: xTableHeaderFixed.

Offline

 

#4 May 16, 2011 4:06:37 pm

infringer
New Member
Registered: May 5, 2011
Posts: 2

Re: xTableHeaderFixed & AJAX

Hi Mike,

Sorry for the long delay.  I was out last week.

That works great for cleaning the fixed header up.  Now I've got another question.

I was previously using the tbody overflow-y: scroll method to create a scrollable table.  of course now with FF4 that is no longer available, so that's how I came across your scripts/library.

What i have is a table, that has clickable headers, which then goes back to the server to "reorder" the request based on the header clicked.  I had previously used a icon to denote ASC/DESC beside the column that was sorted.  Of course now, since you are making a copy of the header, this just stays at the initial state.

I may should just look for a complete datagrid package, but was just trying to find something quick and light to replace the overflow: scroll method i was using.

Thanks,
-David

Offline

 

#5 May 17, 2011 3:15:48 pm

MikeFoster
Administrator
From: Alabama, USA
Registered: April 27, 2007
Posts: 874
Website

Re: xTableHeaderFixed & AJAX

Hi infringer,

Take a look at this demo: http://cross-browser.com/x/examples/xthf-ajax.php

I've added some code to register an event listener for the first TH in the header. This is just a simple example of one way to do this.

Offline

 

Board footer

Powered by PunBB 1.2.15
Copyright © 2002–2005 Rickard Andersson

Expand Restore Select Format Eval Load