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

RE: [ydn-javascript] how to get initial data for datatable from the current html?

Expand Messages
  • carlos.m.vadillo@wellsfargo.com
    We have applications that use thousands of records, and sometimes it is just cheaper in terms of server requests to get all the data in one shot. Get your
    Message 1 of 2 , Aug 27, 2009
      We have applications that use thousands of records, and sometimes it is just cheaper in terms of server requests to get all the data in one shot. Get your array, pass it to the datasource and create your datatable with a paginator. We have use this technique with recordsets in excess of 20,000 records.
       

      - Carlos Vadillo
      (415) 371-4591

       


      From: ydn-javascript@yahoogroups.com [mailto:ydn-javascript@yahoogroups.com] On Behalf Of daveb662001
      Sent: Thursday, August 27, 2009 3:48 PM
      To: ydn-javascript@yahoogroups.com
      Subject: [ydn-javascript] how to get initial data for datatable from the current html?

       

      Hello!
      I already posted this on YUI datatable forum, but just in case this group is more active, I am reposting it here.

      Is it possible to add the json array on the same page where I want to datatable to be created?

      Currently for server-side pagination type of datatable the data is sent from the server, even the initial data. This means that when the user visits an html page that contains the datatable widget, the datatable will request initial data upon page load, resulting in another call to server.

      But I can just include the small script at the bottom of the same html page, call it like oInitialData and it will contain the json formatted rows of data. This way at least the initial ajax request back to the server is not necessary.

      Has anyone already thought of that and found a way to populate the datasource with initial data this way?

    Your message has been successfully submitted and would be delivered to recipients shortly.