views:

19

answers:

1

Hi,

I am newbie to drupal , I just created a view called "master" and i wanna manipulate the output pro grammatically for creating widget (javascript widget can embed in other website).

  $view = views_get_view('master');
  $view->set_display('page');
  $view->execute();
  $viewArray = $view->result;
  $title = $view->display['default']->display_options['title'];
  echo "<h2>$title</h2>";
  echo("<pre>"); print_r ($viewArray); echo("</pre>");

It prints the result(in object form), But the output contains only 10 result which was mentioned while at the time of views creation.Please guide me,

1.how to get the next 10 result pro grammatically (pagination) ?

2.how to theme a views  pro grammatically (since its js widget) ?

3.any live demo tutorial links to play with advanced views?

4.how to do sorting (whether i need to pass through url)?

5.how deal this with handler object?

my view preview looks like this below image

alt text

Thanxs,

Nithish.

+1  A: 

Well, for #1 all you need to do is go into the edit control panel for that view and change the number of records to be shown on each page. Setting it to 0 lets it display all records at once.

For the others ... I wonder if views is the right solution for you. I suspect you might be better off with a custom module that returns a lot of drupal_json() calls. At very least, it's cumbersome and wasteful to be doing all this through views, since views spends so many cycles on rendering.

If you want to avoid coding a custom module, I'd suggest installing the View Bonus Pack (http://drupal.org/project/views_bonus) and using the 'Feed' display types. This will make it marginally easier to manipulate the results with js.

anschauung
@anschauung hmm im working for maintenance website and my client asked for only through views and he also have views_bonus preinstalled in his site. anyway i try to find the way
Nithish