0

I m using Drupal 6
I m using pager_query and theme_table
How can I make any column unsortable, by default it is making all columns sortable

$tableHeader = array(
        array('data' => ''),
        array('data' => 'Article','field' => 'a.title'),
        array('data' => 'From date','field' => ''),
        array('data' => 'To date','field' => ''),
        array('data' => 'Perpetual','field' => ''),
        array('data' => 'Access type ','field' => ''),

        );

here first column shows check boxes along each row so don't want this column sortable
Thanks

0

Looking at the code for tablesort_header the sortable stuff is only added if the particular header item is an array. So you can cancel off certain columns by just setting the header to a string, e.g.:

$tableHeader = array(
  'This colum header is not sortable.',
  array('data' => 'Article','field' => 'a.title'),
  array('data' => 'From date','field' => ''),
  array('data' => 'To date','field' => ''),
  array('data' => 'Perpetual','field' => ''),
  array('data' => 'Access type ','field' => ''),
);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.