Property.html 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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-grid-property-Property-method-constructor'><span id='Ext-grid-property-Property'>/**
  19. </span></span> * A specific {@link Ext.data.Model} type that represents a name/value pair and is made to work with the
  20. * {@link Ext.grid.property.Grid}. Typically, Properties do not need to be created directly as they can be
  21. * created implicitly by simply using the appropriate data configs either via the
  22. * {@link Ext.grid.property.Grid#source} config property or by calling {@link Ext.grid.property.Grid#setSource}.
  23. * However, if the need arises, these records can also be created explicitly as shown below. Example usage:
  24. *
  25. * var rec = new Ext.grid.property.Property({
  26. * name: 'birthday',
  27. * value: Ext.Date.parse('17/06/1962', 'd/m/Y')
  28. * });
  29. * // Add record to an already populated grid
  30. * grid.store.addSorted(rec);
  31. *
  32. * @constructor
  33. * Creates new property.
  34. * @param {Object} config A data object in the format:
  35. * @param {String/String[]} config.name A name or names for the property.
  36. * @param {Mixed/Mixed[]} config.value A value or values for the property.
  37. * The specified value's type will be read automatically by the grid to determine the type of editor to use when
  38. * displaying it.
  39. * @return {Object}
  40. */
  41. Ext.define('Ext.grid.property.Property', {
  42. extend: 'Ext.data.Model',
  43. alternateClassName: 'Ext.PropGridProperty',
  44. fields: [{
  45. name: 'name',
  46. type: 'string'
  47. }, {
  48. name: 'value'
  49. }],
  50. idProperty: 'name'
  51. });</pre>
  52. </body>
  53. </html>