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

Re: [ydn-javascript] Custom sorter for DT

Expand Messages
  • Satyam
    ... No directly ... The Advanced Column Sort section on the DataTable page does not yet reflect the last, fourth argument the custom sort function now receives
    Message 1 of 3 , Sep 30, 2009
    View Source
    • 0 Attachment
      AstroDad escribió:
      >
      >
      > I'm implementing a custom sorter for a DT and have a few questions.
      > The setup first:
      >
      > The DT I'm using this in has any number of columns that are added
      > dynamically at runtime. These columns use custom formatter functions
      > to display their contents. The content that is displayed is not part
      > of the DT row "record" proper - they are dynamically generated (or
      > retrieved).
      >
      > 1. In the custom sort function: it gets two record objects to
      > compare. Is there a way to access the displayed cell contents
      > (instead of the record for that cell)?
      >
      No directly
      >
      > 1.
      >
      >
      > 2. If I can do #1, how can I tell what column generated the sort?
      > Since I don't know how many (if any) columns will be dynamically
      > generated (and added) at runtime, I can't create a custom sort
      > function for each custom column that is added - I have to use
      > one custom sort function, and it needs to know what column id
      > (or index or something) triggered the sort so that I can tell
      > what custom data I'm supposed to be sorting on. Clear as mud, eh?
      >
      The Advanced Column Sort section on the DataTable page does not yet
      reflect the last, fourth argument the custom sort function now receives
      since 2.8, the 'field' property value (for some reason, not the 'key'
      though the two usually match). From the field you can find out the
      Column instance that corresponds to the column being sorted and all its
      properties.

      And your question makes perfect sense, that is why the argument was added.
      > --
      > cheers & beers,
      > Chris
      >
      >
      >
      > ------------------------------------------------------------------------
      >
      >
      > No virus found in this incoming message.
      > Checked by AVG - www.avg.com
      > Version: 8.5.409 / Virus Database: 270.13.115/2404 - Release Date: 09/30/09 05:52:00
      >
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.