Web Interface For Lite Argus Control modules
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

108 lines
3.2 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  4. <title>The source code</title>
  5. <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
  6. <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
  7. </head>
  8. <body onload="prettyPrint();">
  9. <pre class="prettyprint lang-js">/*!
  10. * Ext JS Library 3.3.1
  11. * Copyright(c) 2006-2010 Sencha Inc.
  12. * licensing@sencha.com
  13. * http://www.sencha.com/license
  14. */
  15. <div id="cls-Ext.grid.AbstractSelectionModel"></div>/**
  16. * @class Ext.grid.AbstractSelectionModel
  17. * @extends Ext.util.Observable
  18. * Abstract base class for grid SelectionModels. It provides the interface that should be
  19. * implemented by descendant classes. This class should not be directly instantiated.
  20. * @constructor
  21. */
  22. Ext.grid.AbstractSelectionModel = Ext.extend(Ext.util.Observable, {
  23. <div id="prop-Ext.grid.AbstractSelectionModel-grid"></div>/**
  24. * The GridPanel for which this SelectionModel is handling selection. Read-only.
  25. * @type Object
  26. * @property grid
  27. */
  28. constructor : function(){
  29. this.locked = false;
  30. Ext.grid.AbstractSelectionModel.superclass.constructor.call(this);
  31. },
  32. /** @ignore Called by the grid automatically. Do not call directly. */
  33. init : function(grid){
  34. this.grid = grid;
  35. if(this.lockOnInit){
  36. delete this.lockOnInit;
  37. this.locked = false;
  38. this.lock();
  39. }
  40. this.initEvents();
  41. },
  42. <div id="method-Ext.grid.AbstractSelectionModel-lock"></div>/**
  43. * Locks the selections.
  44. */
  45. lock : function(){
  46. if(!this.locked){
  47. this.locked = true;
  48. // If the grid has been set, then the view is already initialized.
  49. var g = this.grid;
  50. if(g){
  51. g.getView().on({
  52. scope: this,
  53. beforerefresh: this.sortUnLock,
  54. refresh: this.sortLock
  55. });
  56. }else{
  57. this.lockOnInit = true;
  58. }
  59. }
  60. },
  61. // set the lock states before and after a view refresh
  62. sortLock : function() {
  63. this.locked = true;
  64. },
  65. // set the lock states before and after a view refresh
  66. sortUnLock : function() {
  67. this.locked = false;
  68. },
  69. <div id="method-Ext.grid.AbstractSelectionModel-unlock"></div>/**
  70. * Unlocks the selections.
  71. */
  72. unlock : function(){
  73. if(this.locked){
  74. this.locked = false;
  75. var g = this.grid,
  76. gv;
  77. // If the grid has been set, then the view is already initialized.
  78. if(g){
  79. gv = g.getView();
  80. gv.un('beforerefresh', this.sortUnLock, this);
  81. gv.un('refresh', this.sortLock, this);
  82. }else{
  83. delete this.lockOnInit;
  84. }
  85. }
  86. },
  87. <div id="method-Ext.grid.AbstractSelectionModel-isLocked"></div>/**
  88. * Returns true if the selections are locked.
  89. * @return {Boolean}
  90. */
  91. isLocked : function(){
  92. return this.locked;
  93. },
  94. destroy: function(){
  95. this.unlock();
  96. this.purgeListeners();
  97. }
  98. });</pre>
  99. </body>
  100. </html>