dojo:How to format the date type in grid
here is my code. as a result, it can't format any date according to the datePattern.
thank you for any help in advance
<script type="text/javascript">
var store = new dojo.data.ObjectStore({objectStore:new dojo.store.Memory({data:[{MyDate:new Date(2011,1,1)},{MyDate:new Date(2011,1,1)}]})});
dojo.addOnLoad(function()
{
var layout=
[
{field:"MyDate",datatype:"date",dataTypeArgs:{datePattern:"yyyy"}}
];
Grid = new dojox.grid.EnhancedGrid(
{
id:"Grid",
selectable:true,
开发者_运维百科store: store,
structure: layout,
});
Grid.placeAt("GridLayer");
Grid.startup();
});
</script>
<div id="GridLayer" style="width:98%;height:600px"></div>
Docs are being improved for this. Look at the current staging docs for DataGrid near the bottom where it says "See Also" the link for "Demos on how to display and edit date value in grid cells"
精彩评论