网格面板中的ExtJs日期格式 [英] ExtJs Date format in Grid panel
问题描述
请提供语法。
ExtJs提供了一个单独的类来处理日期和它的格式。看看日期课程。有足够的例子和解释如何格式化给定的日期或时间。
要根据您所需的格式在网格中显示日期,您将不得不使用 renderer
方法。在日期列配置中,您需要添加如下渲染器方法:
renderer:function(date){
/ /处理你的日期到你需要的格式并返回
}
重要点:渲染器方法的返回值显示在列上。因此,请确保返回格式化的日期或时间。
How to display date in ExtJS Gridpanel column (Date with time )
Please provide syntax.
ExtJs provides a separate class to handle Dates and it its formatting. Have a look at Date class. There is enough examples and explanation on how to format a given date or time.
To render dates in grids according to your desired formatting you will have to use a renderer
method. In you date column configuration you need to added renderer method as follows:
renderer: function(date){
// process you date to your required format and return it
}
Important point: The return value from the renderer method is displayed onto the column.So, make sure you return your formatted date or time.
这篇关于网格面板中的ExtJs日期格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!