Changeset 541 for trunk/web2


Ignore:
Timestamp:
07/11/08 13:33:37 (14 years ago)
Author:
ramonb
Message:

job_monarch/js/jobgrid.js:

  • render certain cells with filter color

job_monarch/css/styles.css:

  • cell style for filters

job_monarch/templates/header.tpl:

  • add our css
Location:
trunk/web2/addons/job_monarch
Files:
2 added
2 edited

Legend:

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

    r540 r541  
    1010
    1111  Ext.QuickTips.init();
     12
     13  function jobCellClick(grid, rowIndex, columnIndex, e)
     14  {
     15    var fieldName = grid.getColumnModel().getDataIndex(columnIndex);
     16
     17    var view = grid.getView();
     18    var cell = view.getCell( rowIndex, columnIndex );
     19
     20    if( fieldName == 'owner' || fieldName == 'name' || fieldName == 'jid' || fieldName == 'status' || fieldName == 'queue' )
     21    {
     22      Ext.fly(cell).removeClass( 'filter' );
     23      Ext.fly(cell).addClass( 'filterenabled' );
     24    }
     25  }
     26
     27  function jobCellRender( value, metadata, record, rowindex, colindex, store )
     28  {
     29    var fieldName = JobsColumnModel.getColumnById( colindex ).dataIndex;
     30
     31    if( fieldName == 'owner' || fieldName == 'name' || fieldName == 'jid' || fieldName == 'status' || fieldName == 'queue' )
     32    {
     33      metadata.css = 'filter';
     34    }
     35    return value;
     36  }
    1237
    1338  JobProxy = new Ext.data.HttpProxy({
     
    5075        dataIndex: 'jid',
    5176        width: 50,
    52         hidden: false
     77        hidden: false,
     78        renderer: jobCellRender
    5379      },{
    5480        header: 'S',
     
    5783        dataIndex: 'status',
    5884        width: 20,
    59         hidden: false
     85        hidden: false,
     86        renderer: jobCellRender
    6087      },{
    6188        header: 'User',
     
    6491        dataIndex: 'owner',
    6592        width: 60,
    66         hidden: false
     93        hidden: false,
     94        renderer: jobCellRender
    6795      },{
    6896        header: 'Queue',
     
    7199        dataIndex: 'queue',
    72100        width: 60,
    73         hidden: false
     101        hidden: false,
     102        renderer: jobCellRender
    74103      },{
    75104        header: 'Name',
     
    176205      items: JobListingEditorGrid
    177206    });
     207
     208  JobListingEditorGrid.addListener( 'cellclick', jobCellClick );
    178209}
  • trunk/web2/addons/job_monarch/templates/header.tpl

    r538 r541  
    77
    88<link rel="stylesheet" type="text/css" href="./lib/extjs/resources/css/ext-all.css" />
     9<link rel="stylesheet" type="text/css" href="./css/styles.css" />
    910<script type="text/javascript" src="./lib/extjs/adapter/ext/ext-base.js"></script>
    1011<script type="text/javascript" src="./lib/extjs/adapter/ext/ext-base-debug.js"></script>
Note: See TracChangeset for help on using the changeset viewer.