Bonjour,


Je m'en remet de nouveau à vous !
J'ai réussit à utiliser un EditableGrid. j'ai donc voulu continuez sur ma lancé en essayant de coder un TreeGrid en m'inspirant des exemples !

Mais j'ai une erreur : CS is unedefined
Qui "pointe" de ce code la (ligne 3):

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
initColumns : function() {
        var cs = this.columns,
            len = cs.length, 
            columns = [],
            i, c;
Voici donc mon code Jquery :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
/*!
 * Ext JS Library 3.3.1
 * Copyright(c) 2006-2010 Sencha Inc.
 * licensing@sencha.com
 * http://www.sencha.com/license
 */
Ext.onReady(function() {
    Ext.QuickTips.init();
 
    var tree = new Ext.ux.tree.TreeGrid({
        title: 'Core Team Projects',
        width: 500,
        height: 300,
        renderTo: Ext.getBody(),
        enableDD: true,
 
   // COLLONES
   columns : [{
 
			id : 'idtask',
			header : 'Task_name',
			dataIndex : 'idtask',
			width : 220,
			editor : new fm.TextField({
 
				allowBlank : false
			})
		},
		//Colonne Material
		{
			header : 'Material',
			dataIndex : 'material',
			width : 130,
			 editor: new fm.ComboBox({
                typeAhead: true,
                triggerAction: 'all',
                transform: 'material',
                lazyRender: true,
                listClass: 'x-combo-list-small'
            })
		},
 
		//Colonne CC
		{
				header : 'CC',
				dataIndex : 'cc',
				width : 70,
				 editor: new fm.ComboBox({
                typeAhead: true,
                triggerAction: 'all',
                // transform the data already specified in html
                transform: 'cc',
                lazyRender: true,
                listClass: 'x-combo-list-small'
            })
		},
		//colonne Start	
		{
 
			header : 'Start',
			dataIndex : 'start_date',	
			width : 95,
			renderer : formatDate,
			editor : new fm.DateField({
 
				format : 'm/d/y',
				minValue : '01/01/06'
			})
		},
		//colonne END 
		{
			header : 'End',
			dataIndex : 'end_date',	
			width : 95,
			renderer : formatDate,
			editor : new fm.DateField({
 
				format : 'm/d/y',
				minValue : '01/01/06'
			})
		},
 
		//Colonne PLAN
		{
			header : 'Plan',
			dataIndex : 'plan',
			width : 100,
			editor: new fm.NumberField({
                allowBlank: false,
                allowNegative: false,
                maxValue: 100000
            })
		},
 
		//collonne STATUS
 
		{
			header : 'Status',
			dataIndex : 'status',
			width : 80,
			editor : new fm.ComboBox({
 
				typeAhead : true,
				triggerAction: 'all',
                transform: 'status',
                lazyRender: true,
                listClass: 'x-combo-list-small'
            })
 
		},
		//Colonne  BILL
		{
			header : 'Bill',
			dataIndex : 'bill',
			width : 80,
			editor: new fm.NumberField({
                allowBlank: false,
                allowNegative: false,
                maxValue: 100000
            })
		},
		//colonne LOG
		{
 
			header : 'Log',
			dataIndex : 'log',
			width : 50
 
		},
		//Colonne UoM
		{			
			header : 'UoM',
			dataIndex : 'uom',
			width : 70,
			editor : new fm.ComboBox({
 
				typeAhead : true,
				triggerAction: 'all',
                transform: 'uom',
                lazyRender: true,
                listClass: 'x-combo-list-small'
            })
 
		},
		// colonne Done 
		{
			header : 'Done',
			dataIndex : 'done',
			width : 70,
			editor: new fm.NumberField({
                allowBlank: false,
                allowNegative: false,
                maxValue: 100000
            })
		},
		//Colonne CHECK
		{
 
		   xtype: 'checkcolumn',
            header: 'Check',
            dataIndex: 'check',
            width: 55
 
		}],
    });
 
    		   // create the Data Store
    var store = new Ext.data.Store({
        // destroy the store if the grid is destroyed
        autoDestroy: true,
 
        // load remote data using HTTP
        url: 'task.xml',
 
        // specify a XmlReader (coincides with the XML format of the returned data)
        reader: new Ext.data.XmlReader({
            // records will have a 'plant' tag
            record: 'task',
            // use an Array of field definition objects to implicitly create a Record constructor
            fields: [
                // the 'name' below matches the tag name to read, except 'availDate'
                // which is mapped to the tag 'availability'
                {name: 'idtask', type: 'string'},
                {name: 'material'},
                {name: 'cc'},
                {name: 'start_date', mapping: 'availability', type: 'date', dateFormat: 'm/d/Y'},   
                {name: 'end_date', mapping: 'availability', type: 'date', dateFormat: 'm/d/Y'},  
                {name: 'plan', type : 'float'},
                {name: 'status'},
                {name: 'bill', type: 'float'},
                {name: 'log', type: 'string'},
                {name: 'uom'},
                {name: 'done', type: 'float'},
                {name: 'check', type: 'bool'}
 
 
            ]
        }),
 
        sortInfo: {field:'idtask', direction:'ASC'}
    });
 
});

merci d'avance à vous