Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    New to the CF scene
    Join Date
    Jul 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    need help with scrollbartable script - multiple headers

    Hi There! New poster here. I have searched the forums for an answer to my question, but I haven't found anything. Forgive me if the question has an obvious answer or is in general too noobish.

    I am using a jQuery javascript app to make a regular table into a table that has a scrollbar on the right side and can be scrolled.

    The script I mean is here: http://derek.app02.i-sites.com/scrol...arTable-0.1.js

    The purpose is that users can scroll the contents of the table and still see the headers, so that they don't have to remember which column is what.

    To do this, the scrollbartable app extracts the first header of the table and puts it aside:

    Code:
    /* Remove the header and put it before the rest of the table as a new table*/
    var $firstRow = $t.clone();					
    $firstRow.find('tr:not(:first)').remove();
    $t.find('tr:first').remove();     
    $t.before($firstRow);
    However, the table I am using has two tr's in the header:

    Code:
    <table class="rspace scrollbarTableLarge">
    		<thead>
    			<tr>
    				<th rowspan="2">1</th>
    				<th rowspan="2">2</th>
    				<th rowspan="2">3</th>
    				<th rowspan="2">4</th>
    				<th colspan="{$project->getPlannedAnalyses()|@count}">Analyses</th>
    				<th rowspan="2">6</th>
                             </tr>
    			 <tr>
    				{foreach from=$project->getPlannedAnalyses() item=analyse}
    					<th>{$analyse->naam}</th>
    				{/foreach}
    			</tr>
    		</thead>
    		
    		<tbody>
                     .....
                    </tbody>
    So as you see the fifth column has a name "Analyses", and it is subdivided into an arbitrary amount of other colums (as many as there are analyses).

    The Scrollbartable app only puts the first <tr> in the header. All the names of the analyses of teh second <tr> are put in the table itself and scroll away when the table is scrolled.


    How can I modify the javascript in a simple way so that it also takes the second <tr> and puts in in a non-scrollable header?

    Thanks in advance for your answers!
    Last edited by ignus; 07-18-2011 at 10:04 AM.


 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •