Welcome Guest, Not a member yet? Register   Sign In
seperate pagination for multiple views loaded from one controller
#1

[eluser]gnomishperson[/eluser]
I have a controller that uses several models to load the necessary data that is used in 3 different ways. Basically it loads all of the DB records, and then 3 views display those records based on their status determined by certain fields within each record.

So some of the records are at a "pending" status, where a portion of the data needs to be updated. Once the pending data has been updated, the record moved to the "assigned" stage, where again additional (not previously available) options need to be updated. Once those are updated, the last stage or status the records can be is "completed".

I have views for each of the individual statuses, but my problem is the views all use the same controller, and the pagination thats loaded from that particular controller calculates "number of records per page" based on a whole, rather than the displayed data for each view.

What would be the easiest way to get the pagination separate and for each of the individual unique views?

Real Basic Psuedocode:
Code:
class List extends Controller {
    function List() {
       parent::Controller();
       $this->load->models('my models');
    }
    index() {
        $config['pagination stuff'];
        $query = $this->Models;

        $data['stuff from query'];

        $validation checks;

        $this-load->view('main_template');
    }
    update() {
        //used for doing the necessary update from the views
    }
}
Views:
Code:
Main_template() {
    $this->load->view('pending')
    $this->load->view('assigned')
    $this->load->view('completed')
    //pagination only shows up here
}

pending() {
    //data from controller with form fields to update data
    //need pagination here
}
assigned() {
    //data from controller with form fields to update additional data
    //need pagination here
}
completed() {
    //data from controller for viewing purposes only.
    //need pagination here
}

I hope this gives somewhat of an idea of what I'm looking for.
#2

[eluser]gnomishperson[/eluser]
I think I found what I was looking for at http://ellislab.com/forums/viewthread/73728/




Theme © iAndrew 2016 - Forum software by © MyBB