]>
git.proxmox.com Git - extjs.git/blob - extjs/classic/classic/test/specs/grid/column/Date.js
1 describe("Ext.grid.column.Date", function() {
3 var grid
, store
, colRef
;
5 function getCell(rowIdx
, colIdx
) {
6 return grid
.getView().getCellInclusive({
12 function getCellText(rowIdx
, colIdx
) {
13 var cell
= getCell(rowIdx
, colIdx
);
14 return Ext
.fly(cell
).down(grid
.getView().innerSelector
).dom
.innerHTML
;
17 function makeGrid(value
) {
18 store
= new Ext
.data
.Store({
19 model
: spec
.TestModel
,
25 grid
= new Ext
.grid
.Panel({
37 renderTo
: Ext
.getBody()
39 colRef
= grid
.getColumnManager().getColumns();
42 beforeEach(function() {
43 Ext
.define('spec.TestModel', {
44 extend
: 'Ext.data.Model',
47 defaultValue
: undefined
53 Ext
.destroy(grid
, store
);
54 colRef
= store
= grid
= null;
55 Ext
.undefine('spec.TestModel');
56 Ext
.data
.Model
.schema
.clear();
59 describe("renderer", function() {
60 it("should render render non-date values", function() {
62 var text
= getCellText(0, 0);
63 if (text
=== ' ') {
66 expect(text
).toBe(' ');
69 it("should render the date according to the format", function() {
70 makeGrid(new Date(2010, 2, 3));
71 expect(getCellText(0, 0)).toBe('2010-03-03');