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

Re: [ydn-javascript] inline cell editing - how to allow empty date with DateCellEditor

Expand Messages
  • Satyam
    The built-in date formatter is quite dumb, this is the code for it: YAHOO.widget.DataTable.formatDate = function(el, oRecord, oColumn, oData) { var oConfig =
    Message 1 of 2 , May 29 2:04 PM
    • 0 Attachment
      The built-in date formatter is quite dumb, this is the code for it:

      YAHOO.widget.DataTable.formatDate = function(el, oRecord, oColumn, oData) {
      var oConfig = oColumn.dateOptions || this.get("dateOptions");
      el.innerHTML = util.Date.format(oData, oConfig, oConfig.locale);
      };

      no provisions for null values.

      You can change this behavior for all the DataTable by redefining the
      above function. You simply add the corrected code at any place after
      the DataTable source file is included and before any DataTable is
      instantiated. Your definition will redefine the original one.

      You might also want to file a ticket at the yuilibrary site, that is the
      only way it will ever get into the library since that is the database
      the YUI team uses to organize their own work. And if you include the
      patched up function, you'll get it there faster.

      http://yuilibrary.com/projects/yui2/newticket

      Satyam


      rolfsf escribió:
      > I'm trying to implement a datatable with a couple columns of editable dates, but in some cases the date needs to be empty (ie. a date has not been set). The cell can be empty, or maybe display a - or a -/-/- but if I have anything but an actual date in my data, I declares it NaN/NaN/NaN
      >
      > is there a simple way around this?
      >
      >
      >
      > ------------------------------------
      >
      > Yahoo! Groups Links
      >
      >
      >
      > ------------------------------------------------------------------------
      >
      >
      > No virus found in this incoming message.
      > Checked by AVG - www.avg.com
      > Version: 8.5.339 / Virus Database: 270.12.44/2140 - Release Date: 05/28/09 18:09:00
      >
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.