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

Re: The sendrequest method need (oRequest, oCallback),why the example doesn't like i

Expand Messages
  • Lucas Smith
    ... http://developer.yahoo.com/yui/examples/datatable/dt_autocomplete.html ... paginator:[ paginationContainerTop , paginationContainerBottom ] ... The example
    Message 1 of 2 , Oct 31, 2008
    • 0 Attachment
      --- In ydn-javascript@yahoogroups.com, "codetome" <jiezhang@...> wrote:
      >
      > sendrequest(oRequest, oCallback)
      >
      > but the example that
      http://developer.yahoo.com/yui/examples/datatable/dt_autocomplete.html
      >
      >
      > there are code as below:
      >
      > var getTerms = function(query) {
      > myDataSource.sendRequest('datatable=yes&query=' +
      > query + '&zip=' + Dom.get('dt_input_zip').value + queryString,
      > myDataTable.onDataReturnInitializeTable, myDataTable);
      > };
      >
      >
      > I don't know how it works.
      > because I meet the question about change the datasource to refresh
      > datatable .. I learn from the example . it doesn't work!!
      >
      > by the way ... I have two
      paginator:['paginationContainerTop','paginationContainerBottom']
      >
      > and the example have none! help me please
      >

      The example is using the deprecated syntax for sendRequest(req,
      successHandler, handlerScope). In the new world, this is equivalent to
      myDataSource.sendRequest(req,{
      success: successHandler,
      scope: handlerScope
      });

      Please submit a bug on SourceForge about the documentation including
      deprecated syntax
      https://sourceforge.net/tracker2/?func=add&group_id=165715&atid=836476

      Regarding your pagination config, you'll want to configure the
      DataTable to use *one* Paginator that itself is configured to use
      *two* containers.
      var tableConfig = {
      paginator = new YAHOO.widget.Paginator({
      rowsPerPage: 25,
      containers: ['paginationContainerTop','paginationContainerBottom']
      })
      };

      var myDataTable = new YAHOO.widget.DataTable(id,cols,dsource,tableConfig);

      By default, DataTable will auto-configure the Paginator to use one
      container above and one below the table, so you might get away with
      simply not including the containers config for Paginator and letting
      DataTable fill in its defaults.

      Hope this helps,
      Luke
    Your message has been successfully submitted and would be delivered to recipients shortly.