For Programmers: Free Programming Magazines  


Home > Archive > PHP Pear > June 2006 > RE: [PEAR] Query Regarding Paging in datagrid









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author RE: [PEAR] Query Regarding Paging in datagrid
moses@softwaysolutions.com

2006-06-24, 8:09 am



Hello Sir

Can U please tell me what should I Code inside the wrapper
function
function getMyPaging(&$datagrid)
{
...}

Since I use YD Framework the folowing is my coding

$this->datagrid =& new Structures_DataGrid (10,null);
$this->template->register_function('getMyPaging',array(&
$this,'getMyPaging'));
$this->datagrid->fill($this->template);
$this->template->display();

I tried with the following but not solved

function getMyPaging()
{

$params = array('mode' => 'Sliding',
'prevImg' => "<img src='img/prev.jpg' border=0 width=20 height=20>",
'nextImg' => "<img src='img/next.jpg' border=0 width=20 height=20>",
'perPage' => 5
);
$pager = & Pager::factory($params);

}



regards
moses



> -------- Original Message --------
> Subject: Re: [PEAR] Query Regarding Paging in datagrid
> From: Olivier Guilyardi <ojaiml@nerim.net>
> Date: Sat, June 10, 2006 3:31 am
> To: moses@softwaysolutions.com
> Cc: pear-general@lists.php.net
>
> moses@softwaysolutions.com wrote:
time I am passing all the arguments.Is there any other way that where I will call only the getPaging() function and to specify the paging formats some where else and that format should apply to the paging when ever I call the function getPaging() without
passing any arguments .regardsmoses[color=darkred]
>
> You could just write a simple wrapper function, like :
> function getMyPaging(&$datagrid) {...}
>
> Btw, if you use the Smarty renderer (as mentionned in your previous post), you
> can use the Smarty function {getPaging} in your templates. Example :
>
> {getPaging prevImg="<<" nextImg=">>" separator=" | " delta="5"}
>
> Now, what you could do, is to register your getMyPaging() wrapper function with
> : Smarty::registerFunction().
>
> So you should be able to simply write :
>
> {getMyPaging}
>
> --
> og

Mark Wiesemann

2006-06-24, 8:09 am

moses@softwaysolutions.com wrote:

> Can U please tell me what should I Code inside the wrapper
> function
> function getMyPaging(&$datagrid)
> {...}


Please have a look at _smartyGetPaging() in
DataGrid/Renderer/Smarty.php. Doing the same in your code, should do the
job.

Regards,
Mark
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com