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

Re: [ydn-javascript] how to enable client side sorting of datatable or datasource?

Expand Messages
  • Satyam
    You can call the sortColumn function once the table loads, but that will cause a flicker. You might want, instead, to override DataSource.doBeforeCallback to
    Message 1 of 2 , Mar 31, 2009
    • 0 Attachment
      You can call the sortColumn function once the table loads, but that will
      cause a flicker. You might want, instead, to override
      DataSource.doBeforeCallback to sort the data yourself before it leaves
      the DataSource and the DataTable receives it. The built-in
      doBeforeCallback is empty, actually, it just returns one of its
      arguments untouched and whatever that function returns will be what the
      DataTable sees. Override that function and put a breakpoint in it to
      see the arguments, somewhere in there there will be all your data
      already converted to a native JavaScript array. You only need to use
      the native JavaScript Array.sort function on it and return that one.

      Satyam


      shore.cloud escribió:
      > I'm using datasource and datatable,each time datasource sends request
      >
      > to server then give parsed the result to datatable for rendering.
      >
      > However,
      >
      > The result xml response from a http request is sometimes not sorted
      >
      > well at server side,so I need to ensure this by sorting at client side
      >
      > again.
      >
      > Is there a build in schema for datatable or datasource to do this job?
      >
      >
      >
      > ------------------------------------
      >
      > Yahoo! Groups Links
      >
      >
      >
      > ------------------------------------------------------------------------
      >
      >
      > No virus found in this incoming message.
      > Checked by AVG - www.avg.com
      > Version: 8.5.285 / Virus Database: 270.11.32/2030 - Release Date: 03/30/09 08:40:00
      >
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.