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

DataTable, Calendar and new row

Expand Messages
  • babypooh_31
    Hey there :) I have this problem: editable DataTable, 1 of the columns shows dates, definition includes editor: new YAHOO.widget.DateCellEditor() . Works
    Message 1 of 8 , Jan 23, 2009
    • 0 Attachment
      Hey there :)

      I have this problem: editable DataTable, 1 of the columns shows dates,
      definition includes "editor: new YAHOO.widget.DateCellEditor()". Works
      perfect, until the following code adds a new row to the gird:
      "var record = { abc: 'xadf', ...... };
      myDataTable.addRow(record);"
      On the new row TextboxCellEditor works fine, but on click in the dates
      column nothing happens. My guess is addRow() does not update the table
      datasource, which the DateCellEditor tries to read.

      Any thoughts how to solve this?
    • magickrispykreme
      ... I am having very similar problem. My calendar editor looses its ability after I make updates to the table, save its data on the server, then run
      Message 2 of 8 , Feb 6, 2009
      • 0 Attachment
        --- In ydn-javascript@yahoogroups.com, "babypooh_31" <babypooh_31@...>
        wrote:
        >
        > Hey there :)
        >
        > I have this problem: editable DataTable, 1 of the columns shows dates,
        > definition includes "editor: new YAHOO.widget.DateCellEditor()". Works
        > perfect, until the following code adds a new row to the gird:
        > "var record = { abc: 'xadf', ...... };
        > myDataTable.addRow(record);"
        > On the new row TextboxCellEditor works fine, but on click in the dates
        > column nothing happens. My guess is addRow() does not update the table
        > datasource, which the DateCellEditor tries to read.
        >
        > Any thoughts how to solve this?
        >


        I am having very similar problem. My calendar editor looses its
        ability after I make updates to the table, save its data on the
        server, then
        run DT.getRecordSet().replaceRecords(tabledata);

        where tabledata is the JSON array that is returned from server.

        My other editable fields work, but not the datefield.

        My date field are declared this way:

        {
        key: "EndDate",
        label: "End Date",
        formatter: YAHOO.widget.DataTable.formatDate,
        editor: new YAHOO.widget.DateCellEditor(),
        sortable: true,
        sortOptions: {
        defaultDir: YAHOO.widget.DataTable.CLASS_DESC
        },
        resizeable: false,
        width: 80
        },

        Please let me know if you have found an answer to this issue?
      • Satyam
        addRow never updates the DataSource, the DataSource only retrieves the data for the DataTable and it doesn t keep anything. The data is stored in the
        Message 3 of 8 , Feb 7, 2009
        • 0 Attachment
          addRow never updates the DataSource, the DataSource only retrieves the
          data for the DataTable and it doesn't keep anything. The data is stored
          in the DataTable RecordSet. I'm just mentioning this because it is
          often the cause of much confusion, though it doesn't matter in this case.

          Your problem might be the way you are saving the date. The date value
          should be saved into the recordset as a JavaScript Date object. If you
          are saving the date as a text string containing a date value, the date
          editor won't accept it. So, the important part of your code is in those
          ellipsis:

          var record = { abc: 'xadf', ...... };

          how are you setting the default value for the date? This should work:

          var record = { abc: 'xadf', dateField: new Date(), ...... };


          Satyam


          magickrispykreme wrote:
          > --- In ydn-javascript@yahoogroups.com, "babypooh_31" <babypooh_31@...>
          > wrote:
          >
          >> Hey there :)
          >>
          >> I have this problem: editable DataTable, 1 of the columns shows dates,
          >> definition includes "editor: new YAHOO.widget.DateCellEditor()". Works
          >> perfect, until the following code adds a new row to the gird:
          >> "var record = { abc: 'xadf', ...... };
          >> myDataTable.addRow(record);"
          >> On the new row TextboxCellEditor works fine, but on click in the dates
          >> column nothing happens. My guess is addRow() does not update the table
          >> datasource, which the DateCellEditor tries to read.
          >>
          >> Any thoughts how to solve this?
          >>
          >>
          >
          >
          > I am having very similar problem. My calendar editor looses its
          > ability after I make updates to the table, save its data on the
          > server, then
          > run DT.getRecordSet().replaceRecords(tabledata);
          >
          > where tabledata is the JSON array that is returned from server.
          >
          > My other editable fields work, but not the datefield.
          >
          > My date field are declared this way:
          >
          > {
          > key: "EndDate",
          > label: "End Date",
          > formatter: YAHOO.widget.DataTable.formatDate,
          > editor: new YAHOO.widget.DateCellEditor(),
          > sortable: true,
          > sortOptions: {
          > defaultDir: YAHOO.widget.DataTable.CLASS_DESC
          > },
          > resizeable: false,
          > width: 80
          > },
          >
          > Please let me know if you have found an answer to this issue?
          >
          >
          >
          > ------------------------------------
          >
          > Yahoo! Groups Links
          >
          >
          >
          > ------------------------------------------------------------------------
          >
          >
          > No virus found in this incoming message.
          > Checked by AVG - www.avg.com
          > Version: 8.0.233 / Virus Database: 270.10.18/1937 - Release Date: 02/05/09 11:34:00
          >
          >
        • magickrispykreme
          ... stored ... case. ... those ... dates, ... Works ... dates ... table ... 02/05/09 11:34:00 ... Thank you very much, that was the problem. My date was not a
          Message 4 of 8 , Feb 9, 2009
          • 0 Attachment
            --- In ydn-javascript@yahoogroups.com, Satyam <satyam@...> wrote:
            >
            > addRow never updates the DataSource, the DataSource only retrieves the
            > data for the DataTable and it doesn't keep anything. The data is
            stored
            > in the DataTable RecordSet. I'm just mentioning this because it is
            > often the cause of much confusion, though it doesn't matter in this
            case.
            >
            > Your problem might be the way you are saving the date. The date value
            > should be saved into the recordset as a JavaScript Date object. If you
            > are saving the date as a text string containing a date value, the date
            > editor won't accept it. So, the important part of your code is in
            those
            > ellipsis:
            >
            > var record = { abc: 'xadf', ...... };
            >
            > how are you setting the default value for the date? This should work:
            >
            > var record = { abc: 'xadf', dateField: new Date(), ...... };
            >
            >
            > Satyam
            >
            >
            > magickrispykreme wrote:
            > > --- In ydn-javascript@yahoogroups.com, "babypooh_31" <babypooh_31@>
            > > wrote:
            > >
            > >> Hey there :)
            > >>
            > >> I have this problem: editable DataTable, 1 of the columns shows
            dates,
            > >> definition includes "editor: new YAHOO.widget.DateCellEditor()".
            Works
            > >> perfect, until the following code adds a new row to the gird:
            > >> "var record = { abc: 'xadf', ...... };
            > >> myDataTable.addRow(record);"
            > >> On the new row TextboxCellEditor works fine, but on click in the
            dates
            > >> column nothing happens. My guess is addRow() does not update the
            table
            > >> datasource, which the DateCellEditor tries to read.
            > >>
            > >> Any thoughts how to solve this?
            > >>
            > >>
            > >
            > >
            > > I am having very similar problem. My calendar editor looses its
            > > ability after I make updates to the table, save its data on the
            > > server, then
            > > run DT.getRecordSet().replaceRecords(tabledata);
            > >
            > > where tabledata is the JSON array that is returned from server.
            > >
            > > My other editable fields work, but not the datefield.
            > >
            > > My date field are declared this way:
            > >
            > > {
            > > key: "EndDate",
            > > label: "End Date",
            > > formatter: YAHOO.widget.DataTable.formatDate,
            > > editor: new YAHOO.widget.DateCellEditor(),
            > > sortable: true,
            > > sortOptions: {
            > > defaultDir: YAHOO.widget.DataTable.CLASS_DESC
            > > },
            > > resizeable: false,
            > > width: 80
            > > },
            > >
            > > Please let me know if you have found an answer to this issue?
            > >
            > >
            > >
            > > ------------------------------------
            > >
            > > Yahoo! Groups Links
            > >
            > >
            > >
            > >
            ------------------------------------------------------------------------
            > >
            > >
            > > No virus found in this incoming message.
            > > Checked by AVG - www.avg.com
            > > Version: 8.0.233 / Virus Database: 270.10.18/1937 - Release Date:
            02/05/09 11:34:00
            > >
            > >
            >

            Thank you very much, that was the problem. My date was not a date at
            all. I have one more question regarding the calendar if you dont mind,
            how would I set the default pagedate for the date editor?
            What would be the equivalent of this?

            dt = new Date(mydate);
            calendar.cfg.setProperty("PAGEDATE", dt.getMonth()+1 + "/" +
            dt.getFullYear());
          • Satyam
            ... Do nothing, just wait for the soon to come version 2.7. It was a bug. The calendar should automatically show the page corresponding to the field s date,
            Message 5 of 8 , Feb 9, 2009
            • 0 Attachment
              magickrispykreme wrote:
              > --- In ydn-javascript@yahoogroups.com, Satyam <satyam@...> wrote:
              >
              >> addRow never updates the DataSource, the DataSource only retrieves the
              >> data for the DataTable and it doesn't keep anything. The data is
              >>
              > stored
              >
              >> in the DataTable RecordSet. I'm just mentioning this because it is
              >> often the cause of much confusion, though it doesn't matter in this
              >>
              > case.
              >
              >> Your problem might be the way you are saving the date. The date value
              >> should be saved into the recordset as a JavaScript Date object. If you
              >> are saving the date as a text string containing a date value, the date
              >> editor won't accept it. So, the important part of your code is in
              >>
              > those
              >
              >> ellipsis:
              >>
              >> var record = { abc: 'xadf', ...... };
              >>
              >> how are you setting the default value for the date? This should work:
              >>
              >> var record = { abc: 'xadf', dateField: new Date(), ...... };
              >>
              >>
              >> Satyam
              >>
              >>
              >> magickrispykreme wrote:
              >>
              >>> --- In ydn-javascript@yahoogroups.com, "babypooh_31" <babypooh_31@>
              >>> wrote:
              >>>
              >>>
              >>>> Hey there :)
              >>>>
              >>>> I have this problem: editable DataTable, 1 of the columns shows
              >>>>
              > dates,
              >
              >>>> definition includes "editor: new YAHOO.widget.DateCellEditor()".
              >>>>
              > Works
              >
              >>>> perfect, until the following code adds a new row to the gird:
              >>>> "var record = { abc: 'xadf', ...... };
              >>>> myDataTable.addRow(record);"
              >>>> On the new row TextboxCellEditor works fine, but on click in the
              >>>>
              > dates
              >
              >>>> column nothing happens. My guess is addRow() does not update the
              >>>>
              > table
              >
              >>>> datasource, which the DateCellEditor tries to read.
              >>>>
              >>>> Any thoughts how to solve this?
              >>>>
              >>>>
              >>>>
              >>> I am having very similar problem. My calendar editor looses its
              >>> ability after I make updates to the table, save its data on the
              >>> server, then
              >>> run DT.getRecordSet().replaceRecords(tabledata);
              >>>
              >>> where tabledata is the JSON array that is returned from server.
              >>>
              >>> My other editable fields work, but not the datefield.
              >>>
              >>> My date field are declared this way:
              >>>
              >>> {
              >>> key: "EndDate",
              >>> label: "End Date",
              >>> formatter: YAHOO.widget.DataTable.formatDate,
              >>> editor: new YAHOO.widget.DateCellEditor(),
              >>> sortable: true,
              >>> sortOptions: {
              >>> defaultDir: YAHOO.widget.DataTable.CLASS_DESC
              >>> },
              >>> resizeable: false,
              >>> width: 80
              >>> },
              >>>
              >>> Please let me know if you have found an answer to this issue?
              >>>
              >>>
              >>>
              >>> ------------------------------------
              >>>
              >>> Yahoo! Groups Links
              >>>
              >>>
              >>>
              >>>
              >>>
              > ------------------------------------------------------------------------
              >
              >>> No virus found in this incoming message.
              >>> Checked by AVG - www.avg.com
              >>> Version: 8.0.233 / Virus Database: 270.10.18/1937 - Release Date:
              >>>
              > 02/05/09 11:34:00
              >
              >>>
              >
              > Thank you very much, that was the problem. My date was not a date at
              > all. I have one more question regarding the calendar if you dont mind,
              > how would I set the default pagedate for the date editor?
              > What would be the equivalent of this?
              >
              > dt = new Date(mydate);
              > calendar.cfg.setProperty("PAGEDATE", dt.getMonth()+1 + "/" +
              > dt.getFullYear());
              >
              Do nothing, just wait for the soon to come version 2.7. It was a bug.
              The calendar should automatically show the page corresponding to the
              field's date, by using exactly the code you show in the snippet above.
              It was there in the previous version but when all the new separate cell
              editor objects were done, that simple line got overlooked amongst all
              the changes.

              Satyam
            • magickrispykreme
              Did they overlook this bug in the 2.7 version? My date in the calendar is not automatically set to the value of the cell. ... retrieves the ... value ... If
              Message 6 of 8 , Feb 19, 2009
              • 0 Attachment
                Did they overlook this bug in the 2.7 version? My date in the
                calendar is not automatically set to the value of the cell.

                --- In ydn-javascript@yahoogroups.com, Satyam <satyam@...> wrote:
                >
                >
                >
                > magickrispykreme wrote:
                > > --- In ydn-javascript@yahoogroups.com, Satyam <satyam@> wrote:
                > >
                > >> addRow never updates the DataSource, the DataSource only
                retrieves the
                > >> data for the DataTable and it doesn't keep anything. The data is
                > >>
                > > stored
                > >
                > >> in the DataTable RecordSet. I'm just mentioning this because it is
                > >> often the cause of much confusion, though it doesn't matter in this
                > >>
                > > case.
                > >
                > >> Your problem might be the way you are saving the date. The date
                value
                > >> should be saved into the recordset as a JavaScript Date object.
                If you
                > >> are saving the date as a text string containing a date value, the
                date
                > >> editor won't accept it. So, the important part of your code is in
                > >>
                > > those
                > >
                > >> ellipsis:
                > >>
                > >> var record = { abc: 'xadf', ...... };
                > >>
                > >> how are you setting the default value for the date? This should
                work:
                > >>
                > >> var record = { abc: 'xadf', dateField: new Date(), ...... };
                > >>
                > >>
                > >> Satyam
                > >>
                > >>
                > >> magickrispykreme wrote:
                > >>
                > >>> --- In ydn-javascript@yahoogroups.com, "babypooh_31" <babypooh_31@>
                > >>> wrote:
                > >>>
                > >>>
                > >>>> Hey there :)
                > >>>>
                > >>>> I have this problem: editable DataTable, 1 of the columns shows
                > >>>>
                > > dates,
                > >
                > >>>> definition includes "editor: new YAHOO.widget.DateCellEditor()".
                > >>>>
                > > Works
                > >
                > >>>> perfect, until the following code adds a new row to the gird:
                > >>>> "var record = { abc: 'xadf', ...... };
                > >>>> myDataTable.addRow(record);"
                > >>>> On the new row TextboxCellEditor works fine, but on click in the
                > >>>>
                > > dates
                > >
                > >>>> column nothing happens. My guess is addRow() does not update the
                > >>>>
                > > table
                > >
                > >>>> datasource, which the DateCellEditor tries to read.
                > >>>>
                > >>>> Any thoughts how to solve this?
                > >>>>
                > >>>>
                > >>>>
                > >>> I am having very similar problem. My calendar editor looses its
                > >>> ability after I make updates to the table, save its data on the
                > >>> server, then
                > >>> run DT.getRecordSet().replaceRecords(tabledata);
                > >>>
                > >>> where tabledata is the JSON array that is returned from server.
                > >>>
                > >>> My other editable fields work, but not the datefield.
                > >>>
                > >>> My date field are declared this way:
                > >>>
                > >>> {
                > >>> key: "EndDate",
                > >>> label: "End Date",
                > >>> formatter: YAHOO.widget.DataTable.formatDate,
                > >>> editor: new YAHOO.widget.DateCellEditor(),
                > >>> sortable: true,
                > >>> sortOptions: {
                > >>> defaultDir: YAHOO.widget.DataTable.CLASS_DESC
                > >>> },
                > >>> resizeable: false,
                > >>> width: 80
                > >>> },
                > >>>
                > >>> Please let me know if you have found an answer to this issue?
                > >>>
                > >>>
                > >>>
                > >>> ------------------------------------
                > >>>
                > >>> Yahoo! Groups Links
                > >>>
                > >>>
                > >>>
                > >>>
                > >>>
                > >
                ------------------------------------------------------------------------
                > >
                > >>> No virus found in this incoming message.
                > >>> Checked by AVG - www.avg.com
                > >>> Version: 8.0.233 / Virus Database: 270.10.18/1937 - Release Date:
                > >>>
                > > 02/05/09 11:34:00
                > >
                > >>>
                > >
                > > Thank you very much, that was the problem. My date was not a date at
                > > all. I have one more question regarding the calendar if you dont mind,
                > > how would I set the default pagedate for the date editor?
                > > What would be the equivalent of this?
                > >
                > > dt = new Date(mydate);
                > > calendar.cfg.setProperty("PAGEDATE", dt.getMonth()+1 + "/" +
                > > dt.getFullYear());
                > >
                > Do nothing, just wait for the soon to come version 2.7. It was a bug.
                > The calendar should automatically show the page corresponding to the
                > field's date, by using exactly the code you show in the snippet above.
                > It was there in the previous version but when all the new separate cell
                > editor objects were done, that simple line got overlooked amongst all
                > the changes.
                >
                > Satyam
                >
              • magickrispykreme
                ... retrieves the ... value ... If you ... date ... Can anyone confirm if the calendar in the cell of the datatable shows the month of the cell value in 2.7?
                Message 7 of 8 , Feb 23, 2009
                • 0 Attachment
                  --- In ydn-javascript@yahoogroups.com, Satyam <satyam@...> wrote:
                  >
                  >
                  >
                  > magickrispykreme wrote:
                  > > --- In ydn-javascript@yahoogroups.com, Satyam <satyam@> wrote:
                  > >
                  > >> addRow never updates the DataSource, the DataSource only
                  retrieves the
                  > >> data for the DataTable and it doesn't keep anything. The data is
                  > >>
                  > > stored
                  > >
                  > >> in the DataTable RecordSet. I'm just mentioning this because it is
                  > >> often the cause of much confusion, though it doesn't matter in this
                  > >>
                  > > case.
                  > >
                  > >> Your problem might be the way you are saving the date. The date
                  value
                  > >> should be saved into the recordset as a JavaScript Date object.
                  If you
                  > >> are saving the date as a text string containing a date value, the
                  date
                  > >> editor won't accept it. So, the important part of your code is in
                  > >>
                  > > those
                  > >
                  > >> ellipsis:
                  > >>
                  > >> var record = { abc: 'xadf', ...... };
                  > >>
                  > >> how are you setting the default value for the date? This should
                  work:
                  > >>
                  > >> var record = { abc: 'xadf', dateField: new Date(), ...... };
                  > >>
                  > >>
                  > >> Satyam
                  > >>
                  > >>
                  > >> magickrispykreme wrote:
                  > >>
                  > >>> --- In ydn-javascript@yahoogroups.com, "babypooh_31" <babypooh_31@>
                  > >>> wrote:
                  > >>>
                  > >>>
                  > >>>> Hey there :)
                  > >>>>
                  > >>>> I have this problem: editable DataTable, 1 of the columns shows
                  > >>>>
                  > > dates,
                  > >
                  > >>>> definition includes "editor: new YAHOO.widget.DateCellEditor()".
                  > >>>>
                  > > Works
                  > >
                  > >>>> perfect, until the following code adds a new row to the gird:
                  > >>>> "var record = { abc: 'xadf', ...... };
                  > >>>> myDataTable.addRow(record);"
                  > >>>> On the new row TextboxCellEditor works fine, but on click in the
                  > >>>>
                  > > dates
                  > >
                  > >>>> column nothing happens. My guess is addRow() does not update the
                  > >>>>
                  > > table
                  > >
                  > >>>> datasource, which the DateCellEditor tries to read.
                  > >>>>
                  > >>>> Any thoughts how to solve this?
                  > >>>>
                  > >>>>
                  > >>>>
                  > >>> I am having very similar problem. My calendar editor looses its
                  > >>> ability after I make updates to the table, save its data on the
                  > >>> server, then
                  > >>> run DT.getRecordSet().replaceRecords(tabledata);
                  > >>>
                  > >>> where tabledata is the JSON array that is returned from server.
                  > >>>
                  > >>> My other editable fields work, but not the datefield.
                  > >>>
                  > >>> My date field are declared this way:
                  > >>>
                  > >>> {
                  > >>> key: "EndDate",
                  > >>> label: "End Date",
                  > >>> formatter: YAHOO.widget.DataTable.formatDate,
                  > >>> editor: new YAHOO.widget.DateCellEditor(),
                  > >>> sortable: true,
                  > >>> sortOptions: {
                  > >>> defaultDir: YAHOO.widget.DataTable.CLASS_DESC
                  > >>> },
                  > >>> resizeable: false,
                  > >>> width: 80
                  > >>> },
                  > >>>
                  > >>> Please let me know if you have found an answer to this issue?
                  > >>>
                  > >>>
                  > >>>
                  > >>> ------------------------------------
                  > >>>
                  > >>> Yahoo! Groups Links
                  > >>>
                  > >>>
                  > >>>
                  > >>>
                  > >>>
                  > >
                  ------------------------------------------------------------------------
                  > >
                  > >>> No virus found in this incoming message.
                  > >>> Checked by AVG - www.avg.com
                  > >>> Version: 8.0.233 / Virus Database: 270.10.18/1937 - Release Date:
                  > >>>
                  > > 02/05/09 11:34:00
                  > >
                  > >>>
                  > >
                  > > Thank you very much, that was the problem. My date was not a date at
                  > > all. I have one more question regarding the calendar if you dont mind,
                  > > how would I set the default pagedate for the date editor?
                  > > What would be the equivalent of this?
                  > >
                  > > dt = new Date(mydate);
                  > > calendar.cfg.setProperty("PAGEDATE", dt.getMonth()+1 + "/" +
                  > > dt.getFullYear());
                  > >
                  > Do nothing, just wait for the soon to come version 2.7. It was a bug.
                  > The calendar should automatically show the page corresponding to the
                  > field's date, by using exactly the code you show in the snippet above.
                  > It was there in the previous version but when all the new separate cell
                  > editor objects were done, that simple line got overlooked amongst all
                  > the changes.
                  >
                  > Satyam
                  >


                  Can anyone confirm if the calendar in the cell of the datatable shows
                  the month of the cell value in 2.7?
                • bitverdreher
                  ... I know, this thread is quite old. But I had the same problem and this works for me: var calendarBox = new YAHOO.widget.DateCellEditor({ disableBtns: true,
                  Message 8 of 8 , Aug 29 5:33 AM
                  • 0 Attachment
                    --- In ydn-javascript@yahoogroups.com, "magickrispykreme" <anikitos19@...> wrote:

                    > Can anyone confirm if the calendar in the cell of the datatable shows
                    > the month of the cell value in 2.7?
                    >

                    I know, this thread is quite old. But I had the same problem and this works for me:

                    var calendarBox = new YAHOO.widget.DateCellEditor({
                    disableBtns: true,
                    close: true
                    });

                    var setDate = function(oArgs) {
                    var date = oArgs.editor.value;
                    var calendar = oArgs.editor.calendar;

                    calendar.cfg.setProperty("pagedate", date);
                    calendar.cfg.setProperty("selected", date.getMonth()+1 + "/" + date.getDate() + "/" + date.getFullYear());
                    calendar.render();
                    }

                    calendarBox.subscribe('showEvent', setDate);
                  Your message has been successfully submitted and would be delivered to recipients shortly.