/adei/ui

To get this branch, use:
bzr branch http://darksoft.org/webbzr/adei/ui

« back to all changes in this revision

Viewing changes to ui/includes/JavaScripts/userAreaModules/AxisOperations/CreateAxis.js

  • Committer: Aram Yeghikyan
  • Date: 2008-12-02 13:00:06 UTC
  • Revision ID: eghikyan@gmail.com-20081202130006-2786zkp6xe9njsd2
Axis and other staff

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
                        id,
20
20
                        initialJsonObj.Axis[i].Name,
21
21
                        initialJsonObj.Axis[i].Unit,
22
 
                        initialJsonObj.Axis[i].Log
 
22
                        initialJsonObj.Axis[i].Log,
 
23
                        initialJsonObj.Axis[i].RangeBegin,
 
24
                        initialJsonObj.Axis[i].RangeEnd
23
25
                    ];
24
26
                    availableAxis[i] = [
25
27
                        initialJsonObj.Axis[i].Name,
41
43
               {name: 'ID', type: 'int'},
42
44
               {name: 'AxisName', type: 'string'},
43
45
               {name: 'Unit', type: 'string'},
44
 
               {name: 'Log', type: 'boolean'}
 
46
               {name: 'Log', type: 'boolean'},
 
47
               {name: 'RangeBegin', type: 'float'},
 
48
               {name: 'RangeEnd', type: 'float'}
45
49
          ])
46
50
    });
47
51
 
67
71
        {id: 'ID',header: "ID", width: 20, sortable: true, locked:false, dataIndex: 'ID'},
68
72
        {id: 'AxisName',header: "AxisName", width: 200, sortable: true, locked:false, dataIndex: 'AxisName'},
69
73
        {id: 'Unit', header: "Unit", width: 50, sortable: true, dataIndex: 'Unit'},
70
 
        {id: 'Log', header: "Log", width: 75, sortable: true, renderer: Log, dataIndex: 'Log'}
 
74
        {id: 'Log', header: "Log", width: 75, sortable: true, renderer: Log, dataIndex: 'Log'},
 
75
        {id: 'RangeBegin',header: "RangeBegin", width: 100, sortable: true, locked:false, dataIndex: 'RangeBegin'},
 
76
        {id: 'RangeEnd',header: "RangeEnd", width: 100, sortable: true, locked:false, dataIndex: 'RangeEnd'}
71
77
    ]);
72
78
 
73
79
    //bd.createChild({tag: 'h2', html: 'Using a Grid with a Form'});
81
87
        labelAlign: 'left',
82
88
        title: 'Edit',
83
89
        bodyStyle:'padding:5px',
84
 
        width: 700,
 
90
        width: 900,
85
91
        layout: 'column',
86
92
        items: [{
87
93
            columnWidth: 0.6,
100
106
                            Ext.getCmp("AxisName-form").form.findField('Unit').setValue(rec.get("Unit"));
101
107
                            Ext.getCmp("AxisName-form").form.findField('Log').setValue(rec.get("Log"));
102
108
                            Ext.getCmp("AxisName-form").form.findField('ID').setValue(rec.get("ID"));
 
109
                            Ext.getCmp("AxisName-form").form.findField('RangeBegin').setValue(rec.get("RangeBegin"));
 
110
                            Ext.getCmp("AxisName-form").form.findField('RangeEnd').setValue(rec.get("RangeEnd"));
103
111
                        }
104
112
                    }
105
113
                }),
106
114
                autoExpandColumn: 'AxisName',
107
115
                height: 400,
108
 
                width: 400,
 
116
                width: 500,
109
117
                title:'Available Axis',
110
118
                border: true,
111
119
                frame: true,
148
156
                            Ext.getCmp("AxisName-form").form.findField('AxisName').setValue('');
149
157
                            Ext.getCmp("AxisName-form").form.findField('Unit').setValue('');
150
158
                            Ext.getCmp("AxisName-form").form.findField('Log').setValue(false);
 
159
                            Ext.getCmp("AxisName-form").form.findField('RangeBegin').setValue("");
 
160
                            Ext.getCmp("AxisName-form").form.findField('RangeEnd').setValue("");
151
161
                            Ext.getCmp("AxisGrid").getSelectionModel().selectRow(myData.length - 1);
152
162
                        }
153
163
                    },{
159
169
                                "Axis": []
160
170
                            };
161
171
                            for(i=0; i<myData.length; i++){
162
 
                                for(j=1; j<myData[i].length; j++){
 
172
                                for(j=1; j<myData[i].length - 2; j++){
163
173
                                    if(myData[i][j].length == 0){
164
174
                                        corruptedIdsArray.push(i);
165
175
                                        break;
170
180
                                    "Name": myData[i][1],
171
181
                                    "Unit": myData[i][2],
172
182
                                    "Log": myData[i][3],
173
 
                                    "Color": "#ff0011"
 
183
                                    "Color": "#ff0011",
 
184
                                    "RangeBegin": myData[i][4],
 
185
                                    "RangeEnd": myData[i][5]
174
186
                                }
175
187
                                json.Axis[i] = oneRow;
176
188
                            }
239
251
                            Ext.getCmp("AxisName-form").form.findField('AxisName').getValue(),
240
252
                            Ext.getCmp("AxisName-form").form.findField('Unit').getValue(),
241
253
                            Ext.getCmp("AxisName-form").form.findField('Log').getValue(),
 
254
                            Ext.getCmp("AxisName-form").form.findField('RangeBegin').getValue(),
 
255
                            Ext.getCmp("AxisName-form").form.findField('RangeEnd').getValue()
242
256
                        ];
243
257
                        myData[iD] = newRow;
244
258
                        ds.loadData(myData);
257
271
                fieldLabel: 'Unit',
258
272
                name: 'Unit'
259
273
            },{
 
274
                xtype:'fieldset',
 
275
                title: 'Range',
 
276
                collapsible: true,
 
277
                autoHeight:true,
 
278
                defaultType: 'textfield',
 
279
                labelWidth: 40,
 
280
                width: 200,
 
281
                items :[
 
282
                    {
 
283
                        fieldLabel: 'Begin',
 
284
                        width: 130,
 
285
                        name: 'RangeBegin',
 
286
                        xtype: 'numberfield'
 
287
                    },{
 
288
                        fieldLabel: 'End',
 
289
                        width: 130,
 
290
                        name: 'RangeEnd',
 
291
                        xtype: 'numberfield'
 
292
                    }
 
293
                ]
 
294
            },{
260
295
                id: 'Log',
261
296
                xtype:'checkbox',
262
297
                fieldLabel: 'Log',