Ajax of view drupal not working in node body page
I have create the view and enable the paging and ajax option. I display the view开发者_如何学JAVA in drupal page like following.
<?php
$view = views_get_view('nextpagecheck');
print $view->preview('default');
?>
Above code display the view, when click on the next page button it is not working. please can you help why ajax of next page is not working
The problem is that the necessary Javascript isn't getting added to the page, when you embed it that way. There is an issue in the Views issue queue with some solutions.
Fortunately the following code is running and i do not have the ajax problem as well. But when i use the same code in the page which having the form for user to enter the company name and date selection and then view display on the screen. It display fine, but when i click the next button it is not working.The reason is that page button have the url like following
?q=node/45&page=1&selcomp=abc&dfrom=2001/01/01&dto=2002/0/01&submit=submit1; instead of ?q=node/45&page=1;
enter code here
$display_id = 'default';
$view->set_display($display_id);
//print $view->preview('default', $abc);
$item = $view->get_item($display_id, 'filter', 'unix_trandate');
$item['value'] = array('value'=>$dfrom);
$view->set_item($display_id, 'filter', 'unix_trandate', $item);
$item1 = $view->get_item($display_id, 'filter', 'unix_trandate_1');
$item1['value'] = array('value'=>$dto);
$view->set_item($display_id, 'filter', 'unix_trandate_1, $item1);
$view->set_arguments($abc);
$viewsoutput = $view->render(); print $viewsoutput; ?>
I have save the user selection value in session variable and pass this value to view, now it is working. this is not working because the next button work when it load it lost the page variable value
精彩评论