Issue using DateTextBox as an editor in a dGrig

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Issue using DateTextBox as an editor in a dGrig

Harry Devine
I have a grid where one of the fields is a Date and another is a Time.  I'd like to be able to edit those by double-clicking.  When I do this, the initial value does not show up in the DateTextBox or TimeTextBox controls, and if I make any changes to them, the values get displayed similar to the following:

Initial value: 8/12/16
Value after accepting the change from the DateTextBox: Fri Aug 12 2016 00:00:00 GMT-0400 (EDT)

How can I make the grid display the value in the 8/12/16/ format?  I'm using dGrid 0.3.16 and I'm defining the grid as below:

          var StandardGrid = declare([OnDemandGrid, Selection, Pagination, ColumnResizer, DijitRegistry]);
          if (!registry.byId("scoreboardGrid")) {
            mod.scoreboardGrid = new StandardGrid({
              columns: {
                away:   {label: "Away", field: "away", renderCell: mod.formatTeamCell},
                ascore: {label: "Away Score", field: "ascore"},
                home:   {label: "Home", field: "home", renderCell: mod.formatTeamCell},
                hscore: {label: "Home Score", field: "hscore"},
                date:   editor({label: "Game Date", field:"date", editorArgs: {style: "width: 150px;", datePattern: "MM/dd/y", selector: "date"}}, DateTextBox, "dblclick"),
                time:   editor({label: "Game Time", field:"time", editorArgs: {style: "width: 150px;", timePattern: "HH:mm:ss a", selector: "time"}}, TimeTextBox, "dblclick"),
                cut:    {label: "Cutoff", field: "cut", renderCell: mod.formatCutoff},
                tie:    {label: "Tiebreaker", field: "tie", renderCell: mod.formatTiebreaker}
              },
              loadingMessage: "Loading Scores for week " + week,
              errorMessage: "Error loading Scores for week " + 1,
              store: scoresStore,
              sort: [{attribute: "id", descending: false}],
              selectionMode: "none",
              rowsPerPage: 16
            }, "scoreboardGrid");

Thanks,
Harry

--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Loading...