After requery pagination does not work

View: New views
5 Messages — Rating Filter:   Alert me  

After requery pagination does not work

by bahalul kabir :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi satyam or anyone has solution,

After requery pagination does not work .

Event.on("search","click",function()
{
    var support_requery = new YAHOO.widget.DataTable(
      "dynamicdata", support_columnDefs,    new YAHOO.util.XHRDataSource(
              "index.php?show=ajax&module=support&startIndex=0&results='.$numResults.'&searchText=" + searchText + "&searchCriteria="+ searchCriteria,                           
               {
                    responseType:YAHOO.util.DataSource.TYPE_JSON,
                    responseSchema: {
                                    resultsList: "records",
                                    fields: [
                                    {key:"id", parser:"number"},
                                    {key:"subject"},                                    
                                    {key:"date"}
                                    ],
                                    metaFields: {
                                        totalRecords: "totalRecords"
                                    }
                    }
              }
      ),
      {
       // The query arguments are provided here
       initialRequest:"index.php?show=ajax&module=support&startIndex=0&results='.$numResults.'&sort=date&dir=desc&category='.$category.'&status='.$status.'&",
                            dynamicData: true,
                            sortedBy : {key:"date", dir:YAHOO.widget.DataTable.CLASS_DESC},
                            paginator: new YAHOO.widget.Paginator({ rowsPerPage:'.$numResults.' })
      }
     );
                    support_requery.requery("index.php?show=ajax&module=support&startIndex=0&dir=desc&results='.$numResults.'&searchText=" + searchText + "&searchCriteria="+ searchCriteria);
});

Kabir


     

Re: After requery pagination does not work

by Satyam-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I really don't have a solution for it.  My example page says "This does
not work with server side paging and/or sorting."  I wouldn't mind
learning how to make it work, if you find out, I would love to fix my
example.

Satyam

bahalul kabir escribió:

>
>
> Hi satyam or anyone has solution,
>  
> After requery pagination does not work .
>  
> Event.on("search","click",function()
> {
>     var support_requery = new YAHOO.widget.DataTable(
>       "dynamicdata", support_columnDefs,    new YAHOO.util.XHRDataSource(
>               "index.php?show=ajax&module=support&startIndex=0&results='.$numResults.'&searchText="
> + searchText + "&searchCriteria="+
> searchCriteria,                          
>                {
>                     responseType:YAHOO.util.DataSource.TYPE_JSON,
>                     responseSchema: {
>                                     resultsList: "records",
>                                     fields: [
>                                     {key:"id", parser:"number"},
>                                    
> {key:"subject"},                                    
>                                     {key:"date"}
>                                     ],
>                                     metaFields: {
>                                         totalRecords: "totalRecords"
>                                     }
>                     }
>               }
>       ),
>       {
>        // The query arguments are provided here
>        initialRequest:"index.php?show=ajax&module=support&startIndex=0&results='.$numResults.'&sort=date&dir=desc&category='.$category.'&status='.$status.'&",
>                             dynamicData: true,
>                             sortedBy : {key:"date",
> dir:YAHOO.widget.DataTable.CLASS_DESC},
>                             paginator: new YAHOO.widget.Paginator({
> rowsPerPage:'.$numResults.' })
>       }
>      );
>                    
> support_requery.requery("index.php?show=ajax&module=support&startIndex=0&dir=desc&results='.$numResults.'&searchText="
> + searchText + "&searchCriteria="+ searchCriteria);
> });
>  
> Kabir
>
>
>
>
> ------------------------------------------------------------------------
>
>
> No virus found in this incoming message.
> Checked by AVG - www.avg.com
> Version: 9.0.698 / Virus Database: 270.14.48/2479 - Release Date: 11/03/09 20:38:00
>
>  

Re: After requery pagination does not work

by Christian Tiberg :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I really don't know if I'm way off here, but what you want to do seems to be
what we do. We create the datasource separately, and then do this:

dataSource.sendRequest(url, this.myDataTable.onDataReturnInitializeTable,
this.myDataTable);

The URL is the new URL with the updated search query. The table does get
repopulated.

Best regards,
 Christian Tiberg


2009/11/4 bahalul kabir <bahar_aub@...>

>
>
> Hi satyam or anyone has solution,
>
> After requery pagination does not work .
>
> Event.on("search","click",function()
> {
>     var support_requery = new YAHOO.widget.DataTable(
>       "dynamicdata", support_columnDefs,    new YAHOO.util.XHRDataSource(
>               "index.php?show=ajax&module=support&startIndex=0&results='.$numResults.'&searchText="
> + searchText + "&searchCriteria="+
> searchCriteria,
>                {
>                     responseType:YAHOO.util.DataSource.TYPE_JSON,
>                     responseSchema: {
>                                     resultsList: "records",
>                                     fields: [
>                                     {key:"id", parser:"number"},
>
> {key:"subject"},
>                                     {key:"date"}
>                                     ],
>                                     metaFields: {
>                                         totalRecords: "totalRecords"
>                                     }
>                     }
>               }
>       ),
>       {
>        // The query arguments are provided here
>
>        initialRequest:"index.php?show=ajax&module=support&startIndex=0&results='.$numResults.'&sort=date&dir=desc&category='.$category.'&status='.$status.'&",
>                             dynamicData: true,
>                             sortedBy : {key:"date",
> dir:YAHOO.widget.DataTable.CLASS_DESC},
>                             paginator: new YAHOO.widget.Paginator({
> rowsPerPage:'.$numResults.' })
>       }
>      );
>
> support_requery.requery("index.php?show=ajax&module=support&startIndex=0&dir=desc&results='.$numResults.'&searchText="
> + searchText + "&searchCriteria="+ searchCriteria);
> });
>
> Kabir
>
>  
>

Re: After requery pagination does not work

by y_lsmith :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

A few things:
1) Your DataSource should be initialized with just 'index.php?'

2) Your initialRequest and subsequent requery should omit 'index.php?' - e.g. 'show=ajax&module=support&startIndex=0&results='.$numResults.'&sort=date&dir=desc&category='.$category.'&status='.$status

3) Looks like you're not defining the support_requery.handleDataReturnPayload method

4) You should be able to parse the state from the request string passed as the first param to your handleDataReturnPayload

5) Alternately, if your response JSON includes the sort/pagination state in it, you can identify those metaFields as well and pass them to the payload object in your handleDataReturnPayload

6) Alternately, you can modify requery to pass support_requery.getState() in the sendRequest callback object's 'argument' property

HTH,
Luke


--- In ydn-javascript@..., bahalul kabir <bahar_aub@...> wrote:

>
> Hi satyam or anyone has solution,
>
> After requery pagination does not work .
>
> Event.on("search","click",function()
> {
>     var support_requery = new YAHOO.widget.DataTable(
>       "dynamicdata", support_columnDefs,    new YAHOO.util.XHRDataSource(
>               "index.php?show=ajax&module=support&startIndex=0&results='.$numResults.'&searchText=" + searchText + "&searchCriteria="+ searchCriteria,                           
>                {
>                     responseType:YAHOO.util.DataSource.TYPE_JSON,
>                     responseSchema: {
>                                     resultsList: "records",
>                                     fields: [
>                                     {key:"id", parser:"number"},
>                                     {key:"subject"},                                    
>                                     {key:"date"}
>                                     ],
>                                     metaFields: {
>                                         totalRecords: "totalRecords"
>                                     }
>                     }
>               }
>       ),
>       {
>        // The query arguments are provided here
>        initialRequest:"index.php?show=ajax&module=support&startIndex=0&results='.$numResults.'&sort=date&dir=desc&category='.$category.'&status='.$status.'&",
>                             dynamicData: true,
>                             sortedBy : {key:"date", dir:YAHOO.widget.DataTable.CLASS_DESC},
>                             paginator: new YAHOO.widget.Paginator({ rowsPerPage:'.$numResults.' })
>       }
>      );
>                     support_requery.requery("index.php?show=ajax&module=support&startIndex=0&dir=desc&results='.$numResults.'&searchText=" + searchText + "&searchCriteria="+ searchCriteria);
> });
>
> Kabir
>



Re: Re: After requery pagination does not work

by bahalul kabir :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thank you very much Luke also thanx satyam . after requery pagination is working.



________________________________
From: Luke <lucas.e.smith@...>
To: ydn-javascript@...
Sent: Thu, November 5, 2009 8:12:13 AM
Subject: [ydn-javascript] Re: After requery pagination does not work

 
A few things:
1) Your DataSource should be initialized with just 'index.php?'

2) Your initialRequest and subsequent requery should omit 'index.php?' - e.g. 'show=ajax&module= support&startInd ex=0&results= '.$numResults. '&sort=date& dir=desc& category= '.$category. '&status= '.$status

3) Looks like you're not defining the support_requery. handleDataReturn Payload method

4) You should be able to parse the state from the request string passed as the first param to your handleDataReturnPay load

5) Alternately, if your response JSON includes the sort/pagination state in it, you can identify those metaFields as well and pass them to the payload object in your handleDataReturnPay load

6) Alternately, you can modify requery to pass support_requery. getState( ) in the sendRequest callback object's 'argument' property

HTH,
Luke

--- In ydn-javascript@ yahoogroups. com, bahalul kabir <bahar_aub@. ..> wrote:

>
> Hi satyam or anyone has solution,
>
> After requery pagination does not work .
>
> Event.on("search" ,"click", function( )
> {
>     var support_requery = new YAHOO.widget. DataTable(
>       "dynamicdata" , support_ columnDefs,    new YAHOO.util.XHRDataS ource(
>               "index.php?show= ajax&module= support&startInd ex=0&results= '.$numResults. '&searchText= " + searchText + "&searchCriteria= "+ searchCriteria,                           
>                {
>                     responseType: YAHOO.util. DataSource. TYPE_JSON,
>                     responseSchema: {
>                                     resultsList: "records",
>                                     fields: [
>                                     {key:"id", parser:"number" },
>                                     {key:"subject" },                                    
>                                     {key:"date"}
>                                     ],
>                                     metaFields: {
>                                         totalRecords: "totalRecords"
>                                     }
>                     }
>               }
>       ),
>       {
>        // The query arguments are provided here
>        initialRequest: "index.php? show=ajax& module=support& startIndex= 0&results= '.$numResults. '&sort=date& dir=desc& category= '.$category. '&status= '.$status. '&",
>                             dynamicData: true,
>                             sortedBy : {key:"date", dir:YAHOO.widget. DataTable. CLASS_DESC} ,
>                             paginator: new YAHOO.widget. Paginator( { rowsPerPage: '.$numResults. ' })
>       }
>      );
>                     support_requery. requery(" index.php? show=ajax& module=support& startIndex= 0&dir=desc& results=' .$numResults. '&searchText= " + searchText + "&searchCriteria= "+ searchCriteria) ;
> });
>
> Kabir
>