tags:

views:

114

answers:

1

I am Using http://tablesorter.com/docs/example-options-headers.html

 $("#sort-table").tablesorter( 
       {headers: { 

            0: { 
                sorter: false 
               }, 

            dynamic_value: { 
                     sorter: false 
             } 
        } 
    });

How Can pass Dynamic_value for example from $('.header').length ?

<thead>
  <tr>
       <th width="20"><?php echo $check;?></th>
       <th class="header">FullName</th>
       <th class="header">Rank</th>
       <th class="header">Email</th>
       <th class="header">Position</th>
       <th width="15"></th>
    </tr>

+2  A: 

I suppose you want to apply sorter: false to a certain column of which the number has to be calculated dynamically. As far as I know, JavaScript doesn't allow any direct syntax for that, so you'll have to go with the following:

headerset = {
               0: { 
                    sorter: false 
               }
            // any other static column here
            };
// repeat the following line for each dynamic value
headerset[dynamicvalue] = { sorter: false };
// the variable headerset now contains the header settings
// you can apply them to the tablesorter
$("#sort-table").tablesorter({ headers: headerset });

It's not elegant, but it should work.

MvanGeest
thanks .it works what as I want.
python