CheckboxManager.html 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title>The source code</title>
  6. <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
  7. <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
  8. <style type="text/css">
  9. .highlight { display: block; background-color: #ddd; }
  10. </style>
  11. <script type="text/javascript">
  12. function highlight() {
  13. document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
  14. }
  15. </script>
  16. </head>
  17. <body onload="prettyPrint(); highlight();">
  18. <pre class="prettyprint lang-js"><span id='Ext-form-CheckboxManager'>/**
  19. </span> * @private
  20. * Private utility class for managing all {@link Ext.form.field.Checkbox} fields grouped by name.
  21. */
  22. Ext.define('Ext.form.CheckboxManager', {
  23. extend: 'Ext.util.MixedCollection',
  24. singleton: true,
  25. getByName: function(name) {
  26. return this.filterBy(function(item) {
  27. return item.name == name;
  28. });
  29. },
  30. getWithValue: function(name, value) {
  31. return this.filterBy(function(item) {
  32. return item.name == name &amp;&amp; item.inputValue == value;
  33. });
  34. },
  35. getChecked: function(name) {
  36. return this.filterBy(function(item) {
  37. return item.name == name &amp;&amp; item.checked;
  38. });
  39. }
  40. });
  41. </pre>
  42. </body>
  43. </html>