Grid with DateTextBox

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

Grid with DateTextBox

bostondevin

Hello –

 

I am attempting to use the Dojox Grid and have a column be an editable date cell using the dojox.grid.cells.DateTextBox (with the little popup calendar) like this:

 

<TH field="col6" cellType="dojox.grid.cells.DateTextBox" formatter="dateFormatter" editable="true">Date</TH>

 

For the data, I’m using an ItemFileWriteStore and populating the date column with either a prefilled date or null if there isn’t a date.

 

All works fine, however if I pass a null, the calendar opens to 12/31/1969 instead of today’s date. Does anyone know how to make it open to today if the date is null instead of this strange date in the past?

 

Thanks!


_______________________________________________
FAQ: http://dojotoolkit.org/support/faq
Book: http://dojotoolkit.org/docs/book
Forums: http://dojotoolkit.org/forum
[hidden email]
http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Grid with DateTextBox

Darrell J Bulloch
Was this ever answered?  If so, what is the solution?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Grid with DateTextBox


var dateGet = function(index, item){
    if(store.getValue(item, 'dateField') === null){
        return .... // today's date
    }else{
        return grid.get.apply(grid, arguments);
    }
};
Best Regards
-------------
Oliver
zhuxw
In reply to this post by bostondevin
Hi, you can to pre-process the data first using the "get" function:

Date
Loading...