Changeset 558 for trunk/web2/addons/job_monarch/js/jobgrid.js
- Timestamp:
- 01/21/09 17:21:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/web2/addons/job_monarch/js/jobgrid.js
r556 r558 6 6 var myfilters = { }; 7 7 var myparams = { }; 8 var mylimit = 15; 8 9 var ClusterImageArgs = { }; 9 10 10 11 var filterfields = [ "jid", "queue", "name", "owner" ]; 12 13 Ext.namespace('Ext.ux'); 14 15 Ext.ux.PageSizePlugin = function() { 16 Ext.ux.PageSizePlugin.superclass.constructor.call(this, { 17 store: new Ext.data.SimpleStore({ 18 fields: ['text', 'value'], 19 data: [['10', 10], ['15', 15], ['20', 20], ['30', 30], ['50', 50], ['100', 100]] 20 }), 21 mode: 'local', 22 displayField: 'text', 23 valueField: 'value', 24 editable: false, 25 allowBlank: false, 26 triggerAction: 'all', 27 width: 40 28 }); 29 }; 30 31 Ext.extend(Ext.ux.PageSizePlugin, Ext.form.ComboBox, { 32 init: function(paging) { 33 paging.on('render', this.onInitView, this); 34 }, 35 36 onInitView: function(paging) { 37 paging.add('-', 38 this, 39 'jobs per page' 40 ); 41 this.setValue(paging.pageSize); 42 this.on('select', this.onPageSizeChanged, paging); 43 }, 44 45 onPageSizeChanged: function(combo) { 46 this.pageSize = parseInt(combo.getValue()); 47 mylimit = parseInt(combo.getValue()); 48 this.doLoad(0); 49 } 50 }); 51 52 Ext.namespace( 'Ext' ); 11 53 12 54 function makeArrayURL( somearr ) … … 111 153 // Can't be sure if there are enough pages for new filter: reset to page 1 112 154 // 113 myparams = joinMyArray( myparams, { start: 0, limit: 30 } ); 155 //myparams = joinMyArray( myparams, { start: 0, limit: 30 } ); 156 //mylimit = JobListingEditorGrid.bbar.pageSize; 157 myparams = joinMyArray( myparams, { start: 0, limit: mylimit } ); 114 158 115 159 JobsDataStore.reload( { params: myparams } ); … … 202 246 } 203 247 248 Ext.apply(Ext.form.VTypes, { 249 num: function(val, field) { 250 251 if (val) { 252 var strValidChars = "0123456789"; 253 var blnResult = true; 254 255 if (val.length == 0) return false; 256 257 // test strString consists of valid characters listed above 258 for (i = 0; i < val.length && blnResult == true; i++) 259 { 260 strChar = val.charAt(i); 261 if (strValidChars.indexOf(strChar) == -1) 262 { 263 blnResult = false; 264 } 265 } 266 return blnResult; 267 268 } 269 }, 270 numText: 'Must be numeric' 271 }); 272 204 273 function initJobGrid() { 205 274 206 275 Ext.QuickTips.init(); 276 Ext.form.Field.prototype.msgTarget = 'side'; 207 277 208 278 function jobCellClick(grid, rowIndex, columnIndex, e) … … 403 473 stripeRows: true, 404 474 bbar: new Ext.PagingToolbar({ 405 pageSize: 30,475 pageSize: 15, 406 476 store: JobsDataStore, 407 477 displayInfo: true, 408 478 displayMsg: 'Displaying jobs {0} - {1} out of {2} jobs total found.', 409 emptyMsg: 'No jobs found to display' 479 emptyMsg: 'No jobs found to display', 480 plugins: [new Ext.ux.PageSizePlugin()] 410 481 }), 411 482 tbar: [ new Ext.app.SearchField({ 412 483 store: JobsDataStore, 413 params: {start: 0, limit: 30},484 params: {start: 0, limit: mylimit}, 414 485 width: 200 415 486 }) … … 434 505 defaultText: 'Ready.', 435 506 id: 'basic-statusbar', 436 defaultIconCls: '' 507 defaultIconCls: '', 437 508 }) 438 509
Note: See TracChangeset
for help on using the changeset viewer.