source: trunk/web2/addons/job_monarch/js/jobgrid.js @ 532

Last change on this file since 532 was 532, checked in by ramonb, 16 years ago

web2:

  • added Web 2.0 test branch
File size: 32.1 KB
Line 
1var JobsDataStore;
2var JobsColumnModel;
3var JobListingEditorGrid;
4var JobListingWindow;
5
6Ext.onReady(function(){
7
8  Ext.QuickTips.init();
9
10  JobProxy = new Ext.data.HttpProxy({
11                url: 'jobstore.php?c=GINA Cluster',
12                method: 'POST'
13            });
14
15  JobsDataStore = new Ext.data.Store({
16      id: 'JobsDataStore',
17      proxy: JobProxy,
18      baseParams:{task: "LISTING"}, // this parameter is passed for any HTTP request
19      reader: new Ext.data.JsonReader({
20        root: 'results',
21        totalProperty: 'total',
22        id: 'id'
23      },[
24        {name: 'jid', type: 'int', mapping: 'jid'},
25        {name: 'status', type: 'string', mapping: 'status'},
26        {name: 'owner', type: 'string', mapping: 'owner'},
27        {name: 'queue', type: 'string', mapping: 'queue'},
28        {name: 'name', type: 'string', mapping: 'name'},
29        {name: 'requested_time', type: 'string', mapping: 'requested_time'},
30        //{name: 'requested_memory', type: 'string', mapping: 'requested_memory'},
31        {name: 'ppn', type: 'int', mapping: 'ppn'},
32        {name: 'cpu', type: 'int', mapping: 'cpu'},
33        {name: 'nodes', type: 'string', mapping: 'nodes'},
34        {name: 'queued_timestamp', type: 'string', mapping: 'queued_timestamp'},
35        {name: 'start_timestamp', type: 'string', mapping: 'start_timestamp'}
36      ]),
37      sortInfo:{field: 'jid', direction: "ASC"}
38    });
39   
40  JobsColumnModel = new Ext.grid.ColumnModel(
41    [{
42        header: '#',
43        readOnly: true,
44        dataIndex: 'jid',
45        width: 50,
46        hidden: false
47      },{
48        header: 'S',
49        readOnly: true,
50        dataIndex: 'status',
51        width: 20,
52        hidden: false
53      },{
54        header: 'User',
55        readOnly: true,
56        dataIndex: 'owner',
57        width: 60,
58        hidden: false
59      },{
60        header: 'Queue',
61        readOnly: true,
62        dataIndex: 'queue',
63        width: 60,
64        hidden: false
65      },{
66        header: 'Name',
67        readOnly: true,
68        dataIndex: 'name',
69        width: 100,
70        hidden: false
71      },{
72        header: 'Requested CPU time',
73        readOnly: true,
74        dataIndex: 'requested_time',
75        width: 100,
76        hidden: false
77      },{
78        header: 'Requested Memory',
79        readOnly: true,
80        dataIndex: 'requested_memory',
81        width: 100,
82        hidden: true
83      },{
84        header: 'PPN',
85        readOnly: true,
86        dataIndex: 'ppn',
87        width: 25,
88        hidden: false
89      },{
90        header: 'CPU',
91        readOnly: true,
92        dataIndex: 'ppn',
93        width: 25,
94        hidden: false
95      },{
96        header: 'Nodes',
97        readOnly: true,
98        dataIndex: 'nodes',
99        width: 100,
100        hidden: true
101      },{
102        header: 'Queued',
103        readOnly: true,
104        dataIndex: 'queued_timestamp',
105        width: 100,
106        hidden: false
107      },{
108        header: 'Started',
109        readOnly: true,
110        dataIndex: 'start_timestamp',
111        width: 100,
112        hidden: false
113      }]
114    );
115    JobsColumnModel.defaultSortable= true;
116
117  JobListingEditorGrid =  new Ext.grid.EditorGridPanel({
118      id: 'JobListingEditorGrid',
119      store: JobsDataStore,
120      cm: JobsColumnModel,
121      enableColLock:false,
122      clicksToEdit:1,
123      selModel: new Ext.grid.RowSelectionModel({singleSelect:false})
124    });
125
126function debug(){ 
127JobListingEditorGrid.addListener({
128
129        /**
130         * activate : ( Ext.Panel p )
131         * Fires after the Panel has been visually activated. Note that
132         * Panels do not directly support being activated, but some Panel
133         * subclasses do (like Ext.Window). Panels which are child
134         * Components of a TabPanel fire the activate and deactivate events
135         * under the control of the TabPanel.
136         * Listeners will be called with the following arguments:
137         * p : Ext.Panel
138         *     The Panel that has been activated.
139         */
140         'activate':{
141                fn: function(panel){
142                        console.log('Grid listener fired (activate), arguments:',arguments);
143                }
144                ,scope:this
145        }
146
147        /**
148         * add : ( Ext.Container this, Ext.Component component, Number index )
149         * Fires after any Ext.Component is added or inserted into the container.
150         * Listeners will be called with the following arguments:
151         * this : Ext.Container
152         * component : Ext.Component
153         *     The component that was added
154         * index : Number
155         *     The index at which the component was added to the container's items collection
156         */
157        ,'add':{
158                fn: function(container, component, index){
159                        console.log('Grid listener fired (add), arguments:',arguments);
160                }
161                ,scope:this
162        }
163
164        /**
165         * afteredit : ( Object e )
166         * Fires after a cell is edited.
167                 * grid - This grid
168         * record - The record being edited
169         * field - The field name being edited
170         * value - The value being set
171         * originalValue - The original value for the field, before the edit.
172         * row - The grid row index
173         * column - The grid column index
174         *
175         * Listeners will be called with the following arguments:
176         * e : Object
177         *              An edit event (see above for description)
178         */
179        ,'afteredit':{
180                fn: function(event){
181                        console.log('Grid listener fired (afteredit), arguments:',arguments);
182                }
183                ,scope:this
184        }
185
186        /**
187         * afterlayout : ( Ext.Container this, ContainerLayout layout )
188         * Fires when the components in this container are arranged by the
189         * associated layout manager. Listeners will be called with the
190         * following arguments:
191             * this : Ext.Container
192     * layout : ContainerLayout
193     *          The ContainerLayout implementation for this container
194         */
195        ,'afterlayout':{
196                fn: function(container, layout){
197                        console.log('Grid listener fired (afterlayout), arguments:',arguments);
198                }
199                ,scope:this
200        }
201
202        /**
203         * beforeadd : ( Ext.Container this, Ext.Component component, Number index )
204         * Fires before any Ext.Component is added or inserted into the
205         * container. A handler can return false to cancel the add.
206         * Listeners will be called with the following arguments:
207         * this : Ext.Container
208         * component : Ext.Component
209         *              The component being added
210         * index : Number
211         *              The index at which the component will be added to the
212         *              container's items collection
213         */
214        ,'beforeadd':{
215                fn: function(container, component, index){
216                        console.log('Grid listener fired (beforeadd), arguments:',arguments);
217                }
218                ,scope:this
219        }
220
221        /**
222         * beforeadd : ( Ext.Container this, Ext.Component component, Number index )
223         * Fires before any Ext.Component is added or inserted into the
224         * container. A handler can return false to cancel the add.
225         * Listeners will be called with the following arguments:
226         * this : Ext.Container
227         * component : Ext.Component
228         *              The component being added
229         * index : Number
230         *              The index at which the component will be added to the
231         *              container's items collection
232         */
233        ,'beforeadd':{
234                fn: function(container, component, index){
235                        console.log('Grid listener fired (beforeadd), arguments:',arguments);
236                }
237                ,scope:this
238        }
239
240        /**
241         * beforeclose : ( Ext.Panel p )
242         * Fires before the Panel is closed. Note that Panels do not
243         * directly support being closed, but some Panel subclasses do
244         * (like Ext.Window). This event only applies to such subclasses. A
245         * handler can return false to cancel the close.
246         * Listeners will be called with the following arguments:
247         * p : Ext.Panel
248         *              The Panel being closed.
249         */
250        ,'beforeclose':{
251                fn: function(panel){
252                        console.log('Grid listener fired (beforeclose), arguments:',arguments);
253                }
254                ,scope:this
255        }
256
257        /**
258         * beforecollapse : ( Ext.Panel p, Boolean animate )
259         * Fires before the Panel is collapsed. A handler can return
260         * false to cancel the collapse.
261         * Listeners will be called with the following arguments:
262         * p : Ext.Panel
263         *              the Panel being collapsed.
264         * animate : Boolean
265         *              True if the collapse is animated, else false.
266         */
267        ,'beforecollapse':{
268                fn: function(panel, animate){
269                        console.log('Grid listener fired (beforecollapse), arguments:',arguments);
270                }
271                ,scope:this
272        }
273
274        /**
275         * beforedestroy : ( Ext.Component this )
276         * Fires before the component is destroyed. Return false to stop
277         * the destroy.
278         * Listeners will be called with the following arguments:
279         * this : Ext.Component
280         */
281        ,'beforedestroy':{
282                fn: function(component){
283                        console.log('Grid listener fired (beforedestroy), arguments:',arguments);
284                }
285                ,scope:this
286        }
287
288        /**
289         * beforeedit : ( Object e )
290         * Fires before cell editing is triggered. The edit event object
291         * has the following properties
292         * grid - This grid
293         * record - The record being edited
294         * field - The field name being edited
295         * value - The value for the field being edited.
296         * row - The grid row index
297         * column - The grid column index
298         * cancel - Set this to true to cancel the edit or return false
299         * from your handler.
300         *
301         * Listeners will be called with the following arguments:
302         * e : Object
303         *              An edit event (see above for description)
304         */
305        ,'beforeedit':{
306                fn: function(event){
307                        console.log('Grid listener fired (beforeedit), arguments:',arguments);
308                }
309                ,scope:this
310        }
311
312        /**
313         * beforeexpand : ( Ext.Panel p, Boolean animate
314         * Fires before the Panel is expanded. A handler can return false to cancel the expand.
315         * Listeners will be called with the following arguments:
316         * p : Ext.Panel
317         * The Panel being expanded.
318         * animate : Boolean
319         * True if the expand is animated, else false.
320         */
321        ,'beforeexpand':{
322                fn: function(panel, animate){
323                        console.log('Grid listener fired (beforeexpand), arguments:',arguments);
324                }
325                ,scope:this
326        }
327
328        /**
329         * beforehide : ( Ext.Component this )
330         * Fires before the component is hidden. Return false to stop the hide.
331         * Listeners will be called with the following arguments:
332         * this : Ext.Component
333         */
334        ,'beforehide':{
335                fn: function(component){
336                        console.log('Grid listener fired (beforehide), arguments:',arguments);
337                }
338                ,scope:this
339        }
340
341        /**
342         * beforeremove : ( Ext.Container this, Ext.Component component )
343         * Fires before any Ext.Component is removed from the container. A handler
344         * an return false to cancel the remove.
345         * Listeners will be called with the following arguments:
346         * this : Ext.Container
347         * component : Ext.Component
348         * The component being removed
349         */
350        ,'beforeremove':{
351                fn: function(container, component){
352                        console.log('Grid listener fired (beforeremove), arguments:',arguments);
353                }
354                ,scope:this
355        }
356
357        /**
358         * beforerender : ( Ext.Component this )
359         * Fires before the component is rendered. Return false to stop the render.
360         * Listeners will be called with the following arguments:
361         * this : Ext.Component
362         */
363        ,'beforerender':{
364                fn: function(component){
365                        console.log('04 - Grid listener fired (beforerender), arguments:',arguments);
366                }
367                ,scope:this
368        }
369
370        /**
371         * beforeshow : ( Ext.Component this )
372         * Fires before the component is shown. Return false to stop the show.
373         * Listeners will be called with the following arguments:
374         * this : Ext.Component
375         */
376        ,'beforeshow':{
377                fn: function(component){
378                        console.log('Grid listener fired (beforeshow), arguments:',arguments);
379                }
380                ,scope:this
381        }
382
383        /**
384         * beforestaterestore : ( Ext.Component this, Object state )
385         * Fires before the state of the component is restored. Return false to stop the restore.
386         * Listeners will be called with the following arguments:
387         * this : Ext.Component
388         * state : Object
389         * The hash of state values
390         */
391        ,'beforestaterestore':{
392                fn: function(component, state){
393                        console.log('Grid listener fired (beforestaterestore), arguments:',arguments);
394                }
395                ,scope:this
396        }
397
398        /**
399         * beforestatesave : ( Ext.Component this, Object state )
400         * Fires before the state of the component is saved to the configured
401         * state provider. Return false to stop the save.
402         * Listeners will be called with the following arguments:
403         * this : Ext.Component
404         * state : Object
405         * The hash of state values
406         */
407        ,'beforestatesave':{
408                fn: function(component, state){
409                        console.log('Grid listener fired (beforestatesave), arguments:',arguments);
410                }
411                ,scope:this
412        }
413
414        /**
415         * bodyresize : ( Ext.Panel p, Number width, Number height )
416         * Fires after the Panel has been resized.
417         * Listeners will be called with the following arguments:
418         * p : Ext.Panel
419         * the Panel which has been resized.
420         * width : Number
421         * The Panel's new width.
422         * height : Number
423         * The Panel's new height.
424         */
425        ,'bodyresize':{
426                fn: function(panel, width, height){
427                        console.log('08 - Grid listener fired (bodyresize), arguments:',arguments);
428                }
429                ,scope:this
430        }
431
432        /**
433         * bodyscroll : ( Number scrollLeft, Number scrollTop )
434         * Fires when the body element is scrolled
435         * Listeners will be called with the following arguments:
436         * scrollLeft : Number
437         * scrollTop : Number
438         */
439        ,'bodyscroll':{
440                fn: function(scrollLeft, scrollTop){
441                        console.log('Grid listener fired (bodyscroll), arguments:',arguments);
442                }
443                ,scope:this
444        }
445
446        /**
447         * cellclick : ( Grid this, Number rowIndex, Number columnIndex, Ext.EventObject e )
448         * Fires when a cell is clicked. The data for the cell is drawn from the
449         * Record for this row. To access the data in the listener function use the
450         * following technique:
451         * function(grid, rowIndex, columnIndex, e) {
452         *      var record = grid.getStore().getAt(rowIndex);  // Get the Record
453         *  var fieldName = grid.getColumnModel().getDataIndex(columnIndex); // Get field name
454         *  var data = record.get(fieldName);
455         * }
456         * Listeners will be called with the following arguments:
457         * this : Grid
458         * rowIndex : Number
459         * columnIndex : Number
460         * e : Ext.EventObject
461         */
462        ,'cellclick':{
463                fn: function(grid, rowIndex, columnIndex, event){
464                        console.log('Grid listener fired (cellclick), arguments:',arguments);
465                }
466                ,scope:this
467        }
468
469        /**
470         * cellcontextmenu : ( Grid this, Number rowIndex, Number cellIndex, Ext.EventObject e )
471         * Fires when a cell is right clicked
472         * Listeners will be called with the following arguments:
473         * rowIndex : Number
474         * cellIndex : Number
475         * e : Ext.EventObject
476         */
477        ,'cellcontextmenu':{
478                fn: function(grid, rowIndex, cellIndex, event){
479                        console.log('Grid listener fired (cellcontextmenu), arguments:',arguments);
480                }
481                ,scope:this
482        }
483
484        /**
485         * celldblclick : ( Grid this, Number rowIndex, Number columnIndex, Ext.EventObject e )
486         * Fires when a cell is double clicked
487         * Listeners will be called with the following arguments:
488         * this : Grid
489         * rowIndex : Number
490         * columnIndex : Number
491         * e : Ext.EventObject
492         */
493        ,'celldblclick':{
494                fn: function(grid, rowIndex, columnIndex, event){
495                        console.log('Grid listener fired (celldblclick), arguments:',arguments);
496                }
497                ,scope:this
498        }
499
500        /**
501         * cellmousedown : ( Grid this, Number rowIndex, Number columnIndex, Ext.EventObject e )
502         * Fires before a cell is clicked
503         * Listeners will be called with the following arguments:
504         * this : Grid
505         * rowIndex : Number
506         * columnIndex : Number
507         * e : Ext.EventObject
508         */
509        ,'cellmousedown':{
510                fn: function(grid, rowIndex, columnIndex, event){
511                        console.log('Grid listener fired (cellmousedown), arguments:',arguments);
512                }
513                ,scope:this
514        }
515
516        /**
517         * click : ( Ext.EventObject e )
518         * The raw click event for the entire grid.
519         * Listeners will be called with the following arguments:
520         * e : Ext.EventObject
521         */
522        ,'click':{
523                fn: function(event){
524                        console.log('Grid listener fired (click), arguments:',arguments);
525                }
526                ,scope:this
527        }
528
529        /**
530         * close : ( Ext.Panel p )
531         * Fires after the Panel is closed. Note that Panels do not directly support being closed, but some Panel subclasses do (like Ext.Window).
532         * Listeners will be called with the following arguments:
533         * p : Ext.Panel
534         * The Panel that has been closed.
535         */
536        ,'close':{
537                fn: function(panel){
538                        console.log('Grid listener fired (close), arguments:',arguments);
539                }
540                ,scope:this
541        }
542
543        /**
544         * collapse : ( Ext.Panel p )
545         * Fires after the Panel has been collapsed.
546         * Listeners will be called with the following arguments:
547         *  p : Ext.Panel
548         * the Panel that has been collapsed.
549         */
550        ,'collapse':{
551                fn: function(panel){
552                        console.log('Grid listener fired (collapse), arguments:',arguments);
553                }
554                ,scope:this
555        }
556
557        /**
558         * columnmove : ( Number oldIndex, Number newIndex )
559         * Fires when the user moves a column
560         * Listeners will be called with the following arguments:
561         * oldIndex : Number
562         * newIndex : Number
563         */
564        ,'columnmove':{
565                fn: function(oldIndex, newIndex){
566                        console.log('Grid listener fired (columnmove), arguments:',arguments);
567                }
568                ,scope:this
569        }
570
571        /**
572         * columnresize : ( Number columnIndex, Number newSize )
573         * Fires when the user resizes a column
574         * Listeners will be called with the following arguments:
575         * columnIndex : Number
576         * newSize : Number
577         */
578        ,'columnresize':{
579                fn: function(columnIndex, newSize){
580                        console.log('Grid listener fired (columnresize), arguments:',arguments);
581                }
582                ,scope:this
583        }
584
585        /**
586         * contextmenu : ( Ext.EventObject e )
587         * The raw contextmenu event for the entire grid.
588         * Listeners will be called with the following arguments:
589         * e : Ext.EventObject         
590         */
591        ,'contextmenu':{
592                fn: function(event){
593                        console.log('Grid listener fired (contextmenu), arguments:',arguments);
594                }
595                ,scope:this
596        }
597
598        /**
599         * dblclick : ( Ext.EventObject e )
600         * The raw dblclick event for the entire grid.
601         * Listeners will be called with the following arguments:
602         * e : Ext.EventObject
603         */
604        ,'dblclick':{
605                fn: function(event){
606                        console.log('Grid listener fired (dblclick), arguments:',arguments);
607                }
608                ,scope:this
609        }
610
611        /**
612         * deactivate : ( Ext.Panel p )
613         * Fires after the Panel has been visually deactivated. Note that Panels do not directly support being deactivated, but some Panel subclasses do (like Ext.Window). Panels which are child Components of a TabPanel fire the activate and deactivate events under the control of the TabPanel.
614         * Listeners will be called with the following arguments:
615         * p : Ext.Panel
616         * The Panel that has been deactivated.
617         */
618        ,'deactivate':{
619                fn: function(panel){
620                        console.log('Grid listener fired (deactivate), arguments:',arguments);
621                }
622                ,scope:this
623        }
624
625        /**
626         * destroy : ( Ext.Component this )
627         * Fires after the component is destroyed.
628         * Listeners will be called with the following arguments:
629         * this : Ext.Component
630         */
631        ,'destroy':{
632                fn: function(component){
633                        console.log('Grid listener fired (destroy), arguments:',arguments);
634                }
635                ,scope:this
636        }
637
638        /**
639         * disable : ( Ext.Component this )
640         * Fires after the component is disabled.
641         * Listeners will be called with the following arguments:
642         * this : Ext.Component
643         */
644        ,'disable':{
645                fn: function(component){
646                        console.log('Grid listener fired (disable), arguments:',arguments);
647                }
648                ,scope:this
649        }
650
651        /**
652         * enable : ( Ext.Component this )
653         * Fires after the component is enabled.
654         * Listeners will be called with the following arguments:
655         * this : Ext.Component
656         */
657        ,'enable':{
658                fn: function(component){
659                        console.log('Grid listener fired (enable), arguments:',arguments);
660                }
661                ,scope:this
662        }
663
664        /**
665         * expand : ( Ext.Panel p )
666         * Fires after the Panel has been expanded.
667         * Listeners will be called with the following arguments:
668         * p : Ext.Panel
669         * The Panel that has been expanded.
670         */
671        ,'expand':{
672                fn: function(panel){
673                        console.log('Grid listener fired (expand), arguments:',arguments);
674                }
675                ,scope:this
676        }
677
678        /**
679         * headerclick : ( Grid this, Number columnIndex, Ext.EventObject e )
680         * Fires when a header is clicked
681         * Listeners will be called with the following arguments:
682         * this : Grid
683         * columnIndex : Number
684         * e : Ext.EventObject
685         */
686        ,'headerclick':{
687                fn: function(grid, columnIndex, event){
688                        console.log('Grid listener fired (headerclick), arguments:',arguments);
689                }
690                ,scope:this
691        }
692
693        /**
694         * headercontextmenu : ( Grid this, Number columnIndex, Ext.EventObject e )
695         * Fires when a header is right clicked
696         * Listeners will be called with the following arguments:
697         * this : Grid
698         * columnIndex : Number
699         * e : Ext.EventObject
700         */
701        ,'headercontextmenu':{
702                fn: function(grid, columnIndex, event){
703                        console.log('Grid listener fired (headercontextmenu), arguments:',arguments);
704                }
705                ,scope:this
706        }
707
708        /**
709         * headerdblclick : ( Grid this, Number columnIndex, Ext.EventObject e )
710         * Fires when a header cell is double clicked
711         * Listeners will be called with the following arguments:
712         * this : Grid
713         * columnIndex : Number
714         * e : Ext.EventObject
715         */
716        ,'headerdblclick':{
717                fn: function(grid, columnIndex, event){
718                        console.log('Grid listener fired (headerdblclick), arguments:',arguments);
719                }
720                ,scope:this
721        }
722
723        /**
724         * headermousedown : ( Grid this, Number columnIndex, Ext.EventObject e )
725         * Fires before a header is clicked
726         * Listeners will be called with the following arguments:
727         * this : Grid
728         * columnIndex : Number
729         * e : Ext.EventObject
730         */
731        ,'headermousedown':{
732                fn: function(grid, columnIndex, event){
733                        console.log('Grid listener fired (headermousedown), arguments:',arguments);
734                }
735                ,scope:this
736        }
737
738        /**
739         * hide : ( Ext.Component this )
740         * Fires after the component is hidden.
741         * Listeners will be called with the following arguments:
742         * this : Ext.Component
743         */
744        ,'hide':{
745                fn: function(component){
746                        console.log('Grid listener fired (hide), arguments:',arguments);
747                }
748                ,scope:this
749        }
750
751        /**
752         * keydown : ( Ext.EventObject e )
753         * The raw keydown event for the entire grid.
754         * Listeners will be called with the following arguments:
755         * e : Ext.EventObject
756         */
757        ,'keydown':{
758                fn: function(event){
759                        console.log('Grid listener fired (keydown), arguments:',arguments);
760                }
761                ,scope:this
762        }
763
764        /**
765         * keypress : ( Ext.EventObject e )
766         * The raw keypress event for the entire grid.
767         * Listeners will be called with the following arguments:
768         * e : Ext.EventObject
769         */
770        ,'keypress':{
771                fn: function(event){
772                        console.log('Grid listener fired (keypress), arguments:',arguments);
773                }
774                ,scope:this
775        }
776
777        /**
778         * mousedown : ( Ext.EventObject e )
779         * The raw mousedown event for the entire grid.
780         * Listeners will be called with the following arguments:
781         * e : Ext.EventObject
782         */
783        ,'mousedown':{
784                fn: function(event){
785                        //console.log('Grid listener fired (mousedown), arguments:',arguments);
786                }
787                ,scope:this
788        }
789
790        /**
791         * mouseout : ( Ext.EventObject e )
792         * The raw mouseout event for the entire grid.
793         * Listeners will be called with the following arguments:
794         * e : Ext.EventObject
795         */
796        ,'mouseout':{
797                fn: function(event){
798                        //console.log('Grid listener fired (mouseout), arguments:',arguments);
799                }
800                ,scope:this
801        }
802
803        /**
804         * mouseover : ( Ext.EventObject e )
805         * The raw mouseover event for the entire grid.
806         * Listeners will be called with the following arguments:
807         * e : Ext.EventObject
808         */
809        ,'mouseover':{
810                fn: function(event){
811                        console.log('Grid listener fired (mouseover), arguments:',arguments);
812                }
813                ,scope:this
814        }
815
816        /**
817         * mouseup : ( Ext.EventObject e )
818         * The raw mouseup event for the entire grid.
819         * Listeners will be called with the following arguments:
820         * e : Ext.EventObject
821         */
822        ,'mouseup':{
823                fn: function(event){
824                        //console.log('Grid listener fired (mouseup), arguments:',arguments);
825                }
826                ,scope:this
827        }
828
829        /**
830         * move : ( Ext.Component this, Number x, Number y )
831         * Fires after the component is moved.
832         * Listeners will be called with the following arguments:
833         * this : Ext.Component
834         * x : Number
835         * The new x position
836         * y : Number
837         * The new y position
838         */
839        ,'move':{
840                fn: function(component, x, y){
841                        console.log('Grid listener fired (move), arguments:',arguments);
842                }
843                ,scope:this
844        }
845
846        /**
847         * remove : ( Ext.Container this, Ext.Component component )
848         * Fires after any Ext.Component is removed from the container.
849         * Listeners will be called with the following arguments:
850         * this : Ext.Container
851         * component : Ext.Component
852         * The component that was removed
853         */
854        ,'remove':{
855                fn: function(container, component){
856                        console.log('Grid listener fired (remove), arguments:',arguments);
857                }
858                ,scope:this
859        }
860
861        /**
862         * render : ( Ext.Component this )
863         * Fires after the component is rendered.
864         * Listeners will be called with the following arguments:
865         * this : Ext.Component
866         */
867        ,'render':{
868                fn: function(component){
869                        console.log('06 - Grid listener fired (render), arguments:',arguments);
870                }
871                ,scope:this
872        }
873
874        /**
875         * resize : ( Ext.Component this, Number adjWidth, Number adjHeight, Number rawWidth, Number rawHeight )
876         * Fires after the component is resized.
877         * Listeners will be called with the following arguments:
878         * this : Ext.Component
879         * adjWidth : Number
880         * The box-adjusted width that was set
881         * adjHeight : Number
882         * The box-adjusted height that was set
883         * rawWidth : Number
884         * The width that was originally specified
885         * rawHeight : Number
886         * The height that was originally specified
887         */
888        ,'resize':{
889                fn: function(component, adjWidth, adjHeight, rawWidth, rawHeight){
890                        console.log('09 - Grid listener fired (resize), arguments:',arguments);
891                }
892                ,scope:this
893        }
894
895        /**
896         * rowclick : ( Grid this, Number rowIndex, Ext.EventObject e )
897         * Fires when a row is clicked
898         * Listeners will be called with the following arguments:
899         * this : Grid
900         * rowIndex : Number
901         * e : Ext.EventObject
902         */
903        ,'rowclick':{
904                fn: function(grid, rowIndex, event){
905                        console.log('Grid listener fired (rowclick), arguments:',arguments);
906                }
907                ,scope:this
908        }
909
910        /**
911         * rowcontextmenu : ( Grid this, Number rowIndex, Ext.EventObject e )
912         * Fires when a row is right clicked
913         * Listeners will be called with the following arguments:
914         * this : Grid
915         * rowIndex : Number
916         * e : Ext.EventObject
917         */
918        ,'rowcontextmenu':{
919                fn: function(grid, rowIndex, event){
920                        console.log('Grid listener fired (rowcontextmenu), arguments:',arguments);
921                }
922                ,scope:this
923        }
924
925        /**
926         * rowdblclick : ( Grid this, Number rowIndex, Ext.EventObject e )
927         * Fires when a row is double clicked
928         * Listeners will be called with the following arguments:
929         * this : Grid
930         * rowIndex : Number
931         * e : Ext.EventObject 
932         */
933        ,'rowdblclick':{
934                fn: function(grid, rowIndex, event){
935                        console.log('Grid listener fired (rowdblclick), arguments:',arguments);
936                }
937                ,scope:this
938        }
939
940        /**
941         * rowmousedown : ( Grid this, Number rowIndex, Ext.EventObject e )
942         * Fires before a row is clicked
943         * Listeners will be called with the following arguments:
944         * this : Grid
945         * rowIndex : Number
946         * e : Ext.EventObject
947         */
948        ,'rowmousedown':{
949                fn: function(grid, rowIndex, event){
950                        console.log('Grid listener fired (rowmousedown), arguments:',arguments);
951                }
952                ,scope:this
953        }
954
955        /**
956         * show : ( Ext.Component this )
957         * Fires after the component is shown.
958         * Listeners will be called with the following arguments:
959         * this : Ext.Component
960         */
961        ,'show':{
962                fn: function(component){
963                        console.log('Grid listener fired (show), arguments:',arguments);
964                }
965                ,scope:this
966        }
967
968        /**
969         * sortchange : ( Grid this, Object sortInfo )
970         * Fires when the grid's store sort changes
971         * Listeners will be called with the following arguments:
972         * this : Grid
973         * sortInfo : Object
974         * An object with the keys field and direction
975         */
976        ,'sortchange':{
977                fn: function(grid, sortInfo){
978                        console.log('05 - Grid listener fired (sortchange), arguments:',arguments);
979                }
980                ,scope:this
981        }
982
983        /**
984         * staterestore : ( Ext.Component this, Object state )
985         * Fires after the state of the component is restored.
986         * Listeners will be called with the following arguments:
987         * this : Ext.Component
988         * state : Object
989         * The hash of state values
990         */
991        ,'staterestore':{
992                fn: function(component, state){
993                        console.log('Grid listener fired (staterestore), arguments:',arguments);
994                }
995                ,scope:this
996        }
997
998        /**
999         * statesave : ( Ext.Component this, Object state )
1000         * Fires after the state of the component is saved to the configured state provider.
1001         * Listeners will be called with the following arguments:
1002         * this : Ext.Component
1003         * state : Object
1004         * The hash of state values
1005         */
1006        ,'statesave':{
1007                fn: function(component, state){
1008                        console.log('Grid listener fired (statesave), arguments:',arguments);
1009                }
1010                ,scope:this
1011        }
1012
1013        /**
1014         * titlechange : ( Ext.Panel p, String The )
1015         * Fires after the Panel title has been set or changed.
1016         * Listeners will be called with the following arguments:
1017         * p : Ext.Panel
1018         * the Panel which has had its title changed.
1019         * The : String
1020         * new title.
1021         */
1022        ,'titlechange':{
1023                fn: function(panel, title){
1024                        console.log('07 - Grid listener fired (titlechange), arguments:',arguments);
1025                }
1026                ,scope:this
1027        }
1028
1029        /**
1030         * validateedit : ( Object e )
1031         * Fires after a cell is edited, but before the value is set in the record. Return false to cancel the change. The edit event object has the following properties
1032         * grid - This grid
1033         * record - The record being edited
1034         * field - The field name being edited
1035         * value - The value being set
1036         * originalValue - The original value for the field, before the edit.
1037         * row - The grid row index
1038         * column - The grid column index
1039         * cancel - Set this to true to cancel the edit or return false from your handler.
1040         * Listeners will be called with the following arguments:
1041         * e : Object
1042         * An edit event (see above for descriptio
1043         */
1044        ,'validateedit':{
1045                fn: function(e){
1046                        console.log('Grid listener fired (validateedit), arguments:',arguments);
1047                }
1048                ,scope:this
1049        }
1050       
1051});//end grid.addListener
1052
1053/**
1054 * Proxy Listeners
1055 * These listeners are not required but may be handy if you're
1056 * trying to debug your code or see how the process of loading
1057 * the store works.
1058 * I tried adding these as part of the constructor they would
1059 * not fire, but they do appear to work when I add them outside of
1060 * the constructor.
1061 */             
1062JobProxy.on({
1063         'beforeload':{
1064                fn: function(store, options){
1065                        console.log('02 - Proxy listener fired (beforeload), arguments:',arguments);
1066                }
1067                ,scope:this
1068        }
1069        ,'load':{
1070                fn: function(store, options){
1071                        console.log('Proxy listener fired (load), arguments:',arguments);
1072                }
1073                ,scope:this
1074        }
1075        ,'loadexception':{
1076                fn: function(store, options){
1077                        console.log('Proxy listener fired (loadexception), arguments:',arguments);
1078                }
1079                ,scope:this
1080        }
1081});
1082
1083/**
1084 * Ajax request listeners
1085 */
1086Ext.Ajax.on({
1087         //Fires before a network request is made to retrieve a data object:
1088         'beforerequest':{
1089                fn: function(connection, options){
1090                        console.log('03 - Ajax listener fired (beforerequest), arguments(connection, options):',arguments);
1091                }
1092                ,scope:this
1093        }
1094        //Fires if the request was successfully completed:
1095        ,'requestcomplete':{
1096                fn: function(connection, response, options){
1097                        console.log('10 - Ajax listener fired (requestcomplete), arguments(connection, response, options):',arguments);
1098                }
1099                ,scope:this
1100        }
1101        //Fires if an error HTTP status was returned from the server. See HTTP Status Code
1102        //Definitions for details of HTTP status codes:
1103        ,'requestexception':{
1104                fn: function(connection, response, options){
1105                        console.log('Ajax listener fired (requestexception), arguments:(connection, response, options)',arguments);
1106                }
1107                ,scope:this
1108        }
1109});
1110
1111/**
1112 * Adding listeners outside the constructor
1113 */
1114JobsDataStore.on({
1115        'load':{
1116                fn: function(store, records, options){
1117                        console.log('01 - Data Store listener fired (load), arguments:',arguments);
1118                        console.log('         this:',this);
1119                }
1120                ,scope:this
1121        }
1122        ,'loadexception':{
1123                fn: function(httpProxy, dataObject, args, exception){
1124                        console.log('** - Data Store listener fired (loadexception), arguments:',arguments);
1125                }
1126                ,scope:this
1127        }
1128
1129        //add remaining events for education:           
1130        ,'add':{
1131                fn: function(store, records, index){
1132                        console.log('Data Store listener fired (add), arguments:',arguments);
1133                }
1134                ,scope:this
1135        }
1136        ,'beforeload':{
1137                fn: function(store, options){
1138                        console.log('Data Store listener fired fired (beforeload), arguments:',arguments);
1139                }
1140                ,scope:this
1141        }
1142        ,'clear':{
1143                fn: function(store){
1144                        console.log('Data Store listener fired fired (clear), arguments:',arguments);
1145                }
1146                ,scope:this
1147        }
1148        ,'datachanged':{
1149                fn: function(store){
1150                        console.log('11 - Data Store listener fired fired (datachanged), arguments:',arguments);
1151                        console.log('       If you set a breakpoint here the entire grid will be rendered without data');
1152                        console.log('       ...about to "refresh" grid body');
1153                }
1154                ,scope:this
1155        }
1156        ,'remove':{
1157                fn: function(store, record, index){
1158                        console.log('Data Store listener fired fired (remove), arguments:',arguments);
1159                }
1160                ,scope:this
1161        }
1162        ,'update':{
1163                fn: function(store, record, operation){
1164                        console.log('Data Store listener fired fired (update), arguments:',arguments);
1165                }
1166                ,scope:this
1167        }
1168});
1169}
1170   
1171  JobListingWindow = new Ext.Window({
1172      id: 'JobListingWindow',
1173      title: 'Cluster Jobs Overview',
1174      closable:true,
1175      width:700,
1176      height:350,
1177      plain:true,
1178      layout: 'fit',
1179      items: JobListingEditorGrid
1180    });
1181 
1182  JobsDataStore.load();
1183  //JobListingEditorGrid.render();
1184  JobListingWindow.show();
1185 
1186});
Note: See TracBrowser for help on using the repository browser.