Welcome Guest, Not a member yet? Register   Sign In
Pagination with XAJAX
#2

[eluser]sparkling tux[/eluser]
The solution seems quite rigid for me. I've solved the same problem this way:

First, I've added new variable
Code:
var $misc_link_params
as it's exactly what original pagination class is missing - the possibility to add miscellaneous parameters to the links.

Next, there's a part where a string is built from these params:
Code:
// Build line of miscellaneous link params - onclick, etc
        // But only if there are any
        if (!empty($this->misc_link_params))
        {
            $misc_link_params = FALSE;
            
            if (!is_array($this->misc_link_params))
            {
                $this->misc_link_params = (array) $this->misc_link_params;
            }
            
            foreach($this->misc_link_params as $param_name=>$param_value)
            {
                $misc_link_params .= $param_name.'="'.$param_value.'" ';
            }
            
            $this->misc_link_params = $misc_link_params;
            unset($misc_link_params);
        }

Finally, I've add some changes to the parts where links are generated, i.e.
Code:
// Render the "First" link
        if  ($this->cur_page > $this->num_links)
        {
            $output .= $this->first_tag_open.'<a href="'.$this->base_url.'" '.$this->misc_link_params.'>'.$this->first_link.'</a>'.$this->first_tag_close;
        }

Now, I'm able to add any custom parameters to the pagination links.


Messages In This Thread
Pagination with XAJAX - by El Forum - 09-12-2007, 07:18 AM
Pagination with XAJAX - by El Forum - 09-12-2007, 07:33 AM
Pagination with XAJAX - by El Forum - 09-12-2007, 07:52 AM
Pagination with XAJAX - by El Forum - 09-12-2007, 08:05 AM
Pagination with XAJAX - by El Forum - 02-12-2008, 03:59 PM
Pagination with XAJAX - by El Forum - 03-12-2009, 10:08 AM
Pagination with XAJAX - by El Forum - 09-14-2009, 06:02 PM
Pagination with XAJAX - by El Forum - 09-15-2009, 11:35 AM



Theme © iAndrew 2016 - Forum software by © MyBB