Changeset 567 for trunk/web2


Ignore:
Timestamp:
01/26/09 10:22:46 (15 years ago)
Author:
ramonb
Message:

job_monarch/js/jobgrid.js:

  • search query is now properly cleared from filters
  • append filters to Window titles
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/web2/addons/job_monarch/js/jobgrid.js

    r566 r567  
    44var JobListingWindow;
    55var JobProxy;
     6var SearchField;
    67var myfilters = { };
    78var myparams = { };
     
    178179}
    179180
     181function makeFilterString()
     182{
     183  var filter_str = '';
     184
     185  for( arkey in myfilters )
     186  {
     187    filter_str = filter_str + ' > ' + myfilters[arkey];
     188  }
     189
     190  return filter_str;
     191}
     192
    180193var ImageLoader = function( id, url )
    181194{
     
    236249
    237250  ClusterImageWindow.getBottomToolbar().showBusy();
     251
     252  filter_str = 'Nodes Overview' + makeFilterString();
     253  ClusterImageWindow.setTitle( filter_str );
     254
    238255  newClusterImage.load();
    239256}
     
    311328        reloadClusterImage();
    312329      }
     330      filter_str = myparams.c + ' Jobs Overview' + makeFilterString();
     331      JobListingWindow.setTitle( filter_str );
    313332    }
    314333  }
     
    337356            });
    338357
    339   var SearchField;
    340358
    341359  JobsDataStore = new Ext.data.Store({
     
    364382      sortInfo: { field: 'jid', direction: "DESC" },
    365383      remoteSort: true,
    366       listeners: { 'load': {
     384      listeners:
     385        {
     386                'beforeload':
     387                {
     388                        scope: this,
     389                        fn: function()
     390                        {
     391                                if( SearchField )
     392                                {
     393                                        search_value = SearchField.getEl().dom.value;
     394                                        if( search_value == '' )
     395                                        {
     396                                                delete SearchField.store.baseParams['query'];
     397                                                delete myfilters['query'];
     398                                                delete myparams['query'];
     399                                        }
     400                                }
     401                        }
     402                },
     403                'load':
     404                {
    367405                        scope: this,
    368                         fn: function() {
    369                                         if( SearchField ) {
    370                                                 search_value = SearchField.getEl().dom.value;
    371 
    372                                                 if( search_value != '' )
    373                                                 {
    374                                                         myfilters['query']      = search_value;
    375                                                 }
    376 
    377                                                 reloadClusterImage();
    378 
    379                                                 if( search_value != '' )
    380                                                 {
    381                                                         delete myfilters['query'];
    382                                                 }
     406                        fn: function()
     407                        {
     408                                if( SearchField )
     409                                {
     410                                        search_value = SearchField.getEl().dom.value;
     411
     412                                        if( search_value != '' )
     413                                        {
     414                                                myfilters['query']      = search_value;
     415                                        }
     416
     417                                        reloadClusterImage();
     418
     419                                        filter_str = myparams.c + ' Jobs Overview' + makeFilterString();
     420                                        JobListingWindow.setTitle( filter_str );
     421
     422                                        if( search_value != '' )
     423                                        {
     424                                                delete myfilters['query'];
    383425                                        }
    384426                                }
    385427                        }
    386428                }
     429        }
    387430    });
    388431   
     
    510553        {name: 'h', type: 'string', mapping: 'h'},
    511554        {name: 'v', type: 'string', mapping: 'v'},
    512         {name: 'x', type: 'string', mapping: 'x'},
     555        {name: 'x', type: 'string', mapping: 'x'}
    513556      ]),
    514557      listeners: {
     
    564607        if(!win){
    565608            win = new Ext.Window({
     609                        animateTarget: Button,
    566610                        width       : 500,
    567611                        height      : 300,
     
    571615                }
    572616        NodesDataStore.load();
    573         win.show();
     617        win.show(Button);
    574618}
    575619
Note: See TracChangeset for help on using the changeset viewer.