Advertisement
desenvolvedores

GridPanel-javascript

Jun 22nd, 2012
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Erp.Net.GridLancamento = {}
  2.  
  3. /**
  4. expoe o objeto grid no context this
  5. @method
  6. @param {GridPanel} grid objeto do tipo GridPanel a ser exposto
  7. @member Erp.Net.GridLancamento
  8. */
  9. Erp.Net.GridLancamento.initGrid = function (grid) {
  10.     var gridId = grid.id.split('_')[0];
  11.     this[gridId] = grid;
  12.  
  13.     //ajusta o grid interno
  14.     gridId = gridId + "_grdInner";
  15.     this[gridId] = Erp.Net.Util.getComp(gridId);
  16.     Erp.Net.GridLancamento.setInnerGridSize(this[gridId]);
  17. }
  18.  
  19. /**
  20. Ajusta o tamanho do grid dentro da janela
  21. @method
  22. @param {GridPanel} grid objeto do tipo GridPanel a ser exposto
  23. @param {int} width largura do grid
  24. @param {int} height altura do grid
  25. @member Erp.Net.GridLancamento
  26. */
  27. Erp.Net.GridLancamento.setGridSize = function (grid, width, height) {
  28.     if (!width)
  29.         width = Ext.getBody().getWidth();
  30.  
  31.     if (!height)
  32.         height = Ext.getBody().getHeight() - 80;
  33.  
  34.     grid.setSize(width, height);
  35.  
  36.     Erp.Net.GridLancamento.initGrid(grid);
  37. }
  38.  
  39. /**
  40. Ajusta o tamanho do grid interno dentro da janela
  41. @method
  42. @param {GridPanel} grid objeto do tipo GridPanel a ser exposto
  43. @param {int} width largura do grid
  44. @param {int} height altura do grid
  45. @member Erp.Net.GridLancamento
  46. */
  47. Erp.Net.GridLancamento.setInnerGridSize = function (grid) {
  48.     var width = Ext.getBody().getWidth() - 100;
  49.     var height = Ext.getBody().getHeight() - 180;
  50.     grid.setSize(width, height);
  51. }
  52.  
  53. /**
  54. Marcar ou desmarca os checkboxes do grupo
  55. @param {Command} c botão de comando clicado pelo usuário
  56. @param {Object[]} r registros que do grupo
  57. @param {SelectionModel} sm seletor de registros do grid
  58. @member Erp.Net.GridLancamento
  59. @method
  60. */
  61. Erp.Net.GridLancamento.checkGroup = function (c, r, sm) {
  62.     if (c === 'SelectGroup')
  63.         sm.selectRecords(r, true);
  64.     else
  65.         sm.selectRecords(r, false);
  66. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement