tags:

views:

28

answers:

1

Hi

I have custom drupal module. I receive result from a webservice that I need to page. Here is what I am doing

$result = webservice_call_results();

$attributes = array(
   'border'      => 1,
   'cellspacing' => 0,
   'cellpadding' => 5,
   'width' => 600, 
 );

 $rows = array();
 foreach ($result->headers->RPMHeader as $data)
    { 


   $rows[] = array( 
      l(t($data->reg_no), 
      round($data->total_payment,2),
      $data->prepared_by
      );
 }
$headers =  array(t(' Reg Number'), t('Total Payment'),t('Prepared By')); 
$output =theme('table',$headers,$rows,$attributes); 

$output .= theme('pager', 1);  // Not Working -- Paging

$form['manufacturer_search']['table'] = array(
  '#type' => 'markup',
  '#value' => $output);

The paging is not working. Any Idea why, please help

A: 

You're missing an argument in theme_pager:

theme_pager($tags = array(), $limit = 10, $element = 0, $parameters = array(), $quantity = 9)

Try:

$output .= theme('pager', NULL, 1);
lazysoundsystem
No It doesn't work.
Krishma
Looks like the problem is here:http://drupal.org/node/330748To make it work you need to limit the number of items the theme fucntion receives. This is normally done with pager_query from a database - but it might not suit your workflow.
lazysoundsystem

related questions