Loading ...
Sorry, an error occurred while loading the content.
 

Pagination with autocomplete datatable

Expand Messages
  • phanindra valluri
    Hi All... I am using pagination in my datatable with autocomplete, pagination is working fine only when my datatable is loaded for my initailRequest . But
    Message 1 of 4 , May 27, 2009
      Hi All...


      I am using pagination in my datatable with autocomplete, pagination is working fine only when my datatable is loaded for my "initailRequest".

      But pagination is disappers when I queries a new request. 
      How to make pagination work, when i queried for an newrequest.

      My Code is as follows...


      var acdtDataSource = new YAHOO.util.DataSource("/common/lov.aspx?");
      acdtDataSource.responseType = YAHOO.util.DataSource.TYPE_JSON;
      acdtDataSource.connXhrMode = "queueRequests";
      acdtDataSource.responseSchema = {
      resultsList: "ResultSet.Result",
      fields: ["accno","title","stype","call_no","aname"]
      };

      var acdTDataTableConfigs = {
                  initialRequest: 'datatable=yes&output=json&keyword=acdtBcsrh&accno=&title=a&callno=',
                  paginator: new YAHOO.widget.Paginator({
                      rowsPerPage: 15 
                  })


      Can any one help me please, 
      Thanks in advance

      Regards
      Phanindra.


      Share files, take polls, and make new friends - all under one roof. Click here.
    • Lucas Smith
      ... Phanindra, Can you include the code from the AutoComplete that is interacting with the DataSource/DataTable? Luke
      Message 2 of 4 , May 28, 2009
        --- In ydn-javascript@yahoogroups.com, phanindra valluri <phanindra16@...> wrote:
        >
        > Hi All...
        >
        >
        > I am using pagination in my datatable with autocomplete, pagination is working fine only when my datatable is loaded for my "initailRequest".
        >
        > But pagination is disappers when I queries a new request.
        > How to make pagination work, when i queried for an newrequest.
        >
        > My Code is as follows...
        >
        >
        > varacdtDataSource = new YAHOO.util.DataSource("/common/lov.aspx?");
        > acdtDataSource.responseType = YAHOO.util.DataSource.TYPE_JSON;
        > acdtDataSource.connXhrMode = "queueRequests";
        > acdtDataSource.responseSchema = {
        > resultsList: "ResultSet.Result",
        > fields: ["accno","title","stype","call_no","aname"]
        > };
        >
        > var acdTDataTableConfigs = {
        > initialRequest: 'datatable=yes&output=json&keyword=acdtBcsrh&accno=&title=a&callno=',
        > paginator: new YAHOO.widget.Paginator({
        > rowsPerPage: 15
        > })
        >
        >
        > Can any one help me please,
        > Thanks in advance
        >
        > Regards
        > Phanindra.
        >

        Phanindra,

        Can you include the code from the AutoComplete that is interacting with the DataSource/DataTable?

        Luke
      • phanindra valluri
        Luke My is code is as follows... var Dom = YAHOO.util.Dom; var getTitle = function(title) {
        Message 3 of 4 , May 28, 2009
          Luke

          My is code is as follows...

          var Dom = YAHOO.util.Dom;
          var getTitle = function(title) {
          acdtDataSource.makeConnection('datatable=yes&output=json&keyword=acdtBcsrh&title=' +title ,
          acdtDataTable.onDataReturnInitializeTable, acdtDataTable);
          };
          var oACDS_Title = new YAHOO.util.FunctionDataSource(getTitle);
          var oAutoComp_Title = new YAHOO.widget.AutoComplete("bCSearchByTitleInput","bCSearchByTitleContainer", oACDS_Title);
          var acdtColumnDefs = [
          { key:"stype",label:"Status",width:100 },
          { key:"accno",label:"Accession No",width:120},
          { key:"title",label:"Title",width:250}, 
          { key:"call_no",label:"Call No",width:100 },
          { key:"aname",label:"Authors",width:250 }
                 ];
            
          var acdtDataSource = new YAHOO.util.DataSource("myhost/myreq/myjson.aspx?");
          acdtDataSource.responseType = YAHOO.util.DataSource.TYPE_JSON;
          acdtDataSource.connXhrMode = "queueRequests";
          acdtDataSource.responseSchema = {
          resultsList: "ResultSet.Result",
          fields: ["accno","title","stype","call_no","aname"]
          };
          var acdTDataTableConfigs = {
                      initialRequest: 'datatable=yes&output=json&keyword=acdtBcsrh&title=a',
                      paginator: new YAHOO.widget.Paginator({
                          rowsPerPage: 15 
                          })
                   }
          var acdtDataTable = new YAHOO.widget.DataTable("acdtBookCopyData", acdtColumnDefs,
          acdtDataSource, acdTDataTableConfigs );  


          From: Lucas Smith <lsmith@...>
          To: ydn-javascript@yahoogroups.com
          Sent: Thursday, 28 May, 2009 10:07:18 PM
          Subject: [ydn-javascript] Re: Pagination with autocomplete datatable

          --- In ydn-javascript@ yahoogroups. com, phanindra valluri <phanindra16@ ...> wrote:
          >
          > Hi All...
          >
          >
          > I am using pagination in my datatable with autocomplete, pagination is working fine only when my datatable is loaded for my "initailRequest" .
          >
          > But pagination is disappers when I queries a new request.
          > How to make pagination work, when i queried for an newrequest.
          >
          > My Code is as follows...
          >
          >
          > varacdtDataSource = new YAHOO.util.DataSour ce("/common/ lov.aspx? ");
          > acdtDataSource. responseType = YAHOO.util.DataSour ce.TYPE_JSON;
          > acdtDataSource. connXhrMode = "queueRequests" ;
          > acdtDataSource. responseSchema = {
          > resultsList: "ResultSet.Result" ,
          > fields: ["accno","title" ,"stype", "call_no" ,"aname"]
          > };
          >
          > var acdTDataTableConfig s = {
          > initialRequest: 'datatable=yes& output=json& keyword=acdtBcsr h&accno=& title=a&callno= ',
          > paginator: new YAHOO.widget. Paginator( {
          > rowsPerPage: 15
          > })
          >
          >
          > Can any one help me please,
          > Thanks in advance
          >
          > Regards
          > Phanindra.
          >

          Phanindra,

          Can you include the code from the AutoComplete that is interacting with the DataSource/DataTabl e?

          Luke



          Explore and discover exciting holidays and getaways with Yahoo! India Travel Click here!
        • Lucas Smith
          What version of YUI are you using? You ll probably want to add metaFields: { totalRecords: someLocation } to your DataSource schema. And if you re using YUI
          Message 4 of 4 , May 29, 2009
            What version of YUI are you using?

            You'll probably want to add

            metaFields: { totalRecords: 'someLocation' }

            to your DataSource schema. And if you're using YUI 2.7.0, set the DataTable configuration

            dynamicData: true

            And add the handleDataReturnPayload override to migrate the value from the server response to the DataTable's payload.

            myDataTable.handleDataReturnPayload = function(req, res, payload) {
            payload = payload || {};
            payload.totalRecords = res.meta.totalRecords;
            return payload;
            };

            http://developer.yahoo.com/yui/datatable/#dynamicdata

            L

            --- In ydn-javascript@yahoogroups.com, phanindra valluri <phanindra16@...> wrote:
            >
            > Luke
            >
            > My is code is as follows...
            >
            > var Dom = YAHOO.util.Dom;
            > var getTitle = function(title) {
            > acdtDataSource.makeConnection('datatable=yes&output=json&keyword=acdtBcsrh&title=' +title ,
            > acdtDataTable.onDataReturnInitializeTable, acdtDataTable);
            > };
            > var oACDS_Title = new YAHOO.util.FunctionDataSource(getTitle);
            > var oAutoComp_Title = new YAHOO.widget.AutoComplete("bCSearchByTitleInput","bCSearchByTitleContainer", oACDS_Title);
            > var acdtColumnDefs = [
            > { key:"stype",label:"Status",width:100 },
            > { key:"accno",label:"Accession No",width:120},
            > { key:"title",label:"Title",width:250},
            > { key:"call_no",label:"Call No",width:100 },
            > { key:"aname",label:"Authors",width:250 }
            > ];
            >
            > varacdtDataSource = new YAHOO.util.DataSource("myhost/myreq/myjson.aspx?");
            > acdtDataSource.responseType = YAHOO.util.DataSource.TYPE_JSON;
            > acdtDataSource.connXhrMode = "queueRequests";
            > acdtDataSource.responseSchema = {
            > resultsList: "ResultSet.Result",
            > fields: ["accno","title","stype","call_no","aname"]
            > };
            > var acdTDataTableConfigs = {
            > initialRequest: 'datatable=yes&output=json&keyword=acdtBcsrh&title=a',
            > paginator: new YAHOO.widget.Paginator({
            > rowsPerPage: 15
            > })
            > }
            > var acdtDataTable = new YAHOO.widget.DataTable("acdtBookCopyData", acdtColumnDefs,
            > acdtDataSource, acdTDataTableConfigs );
            >
            >
            >
            > ________________________________
            > From: Lucas Smith <lsmith@...>
            > To: ydn-javascript@yahoogroups.com
            > Sent: Thursday, 28 May, 2009 10:07:18 PM
            > Subject: [ydn-javascript] Re: Pagination with autocomplete datatable
            >
            >
            >
            >
            >
            > --- In ydn-javascript@ yahoogroups. com, phanindra valluri <phanindra16@ ...> wrote:
            > >
            > > Hi All...
            > >
            > >
            > > I am using pagination in my datatable with autocomplete, pagination is working fine only when my datatable is loaded for my "initailRequest" .
            > >
            > > But pagination is disappers when I queries a new request.
            > > How to make pagination work, when i queried for an newrequest.
            > >
            > > My Code is as follows...
            > >
            > >
            > > varacdtDataSource = new YAHOO.util.DataSour ce("/common/ lov.aspx? ");
            > > acdtDataSource. responseType = YAHOO.util.DataSour ce.TYPE_JSON;
            > > acdtDataSource. connXhrMode = "queueRequests" ;
            > > acdtDataSource. responseSchema = {
            > > resultsList: "ResultSet.Result" ,
            > > fields: ["accno","title" ,"stype", "call_no" ,"aname"]
            > > };
            > >
            > > var acdTDataTableConfig s = {
            > > initialRequest: 'datatable=yes& output=json& keyword=acdtBcsr h&accno=& title=a&callno= ',
            > > paginator: new YAHOO.widget. Paginator( {
            > > rowsPerPage: 15
            > > })
            > >
            > >
            > > Can any one help me please,
            > > Thanks in advance
            > >
            > > Regards
            > > Phanindra.
            > >
            >
            > Phanindra,
            >
            > Can you include the code from the AutoComplete that is interacting with the DataSource/DataTabl e?
            >
            > Luke
            >
            >
            >
            >
            >
            > Explore and discover exciting holidays and getaways with Yahoo! India Travel http://in.travel.yahoo.com/
            >
          Your message has been successfully submitted and would be delivered to recipients shortly.