extjs-rails 4.1.0.alpha5 → 4.1.0.alpha6
Sign up to get free protection for your applications and to get access to all the features.
- data/app/assets/javascripts/extjs-rails.js +95613 -11000
- data/lib/extjs-rails/version.rb +1 -1
- metadata +2 -509
- data/app/assets/javascripts/src/AbstractComponent.js +0 -3290
- data/app/assets/javascripts/src/AbstractManager.js +0 -144
- data/app/assets/javascripts/src/AbstractPlugin.js +0 -72
- data/app/assets/javascripts/src/Action.js +0 -276
- data/app/assets/javascripts/src/Ajax.js +0 -99
- data/app/assets/javascripts/src/Component.js +0 -1344
- data/app/assets/javascripts/src/ComponentLoader.js +0 -202
- data/app/assets/javascripts/src/ComponentManager.js +0 -47
- data/app/assets/javascripts/src/ComponentQuery.js +0 -521
- data/app/assets/javascripts/src/Editor.js +0 -494
- data/app/assets/javascripts/src/ElementLoader.js +0 -404
- data/app/assets/javascripts/src/FocusManager.js +0 -712
- data/app/assets/javascripts/src/Img.js +0 -111
- data/app/assets/javascripts/src/Layer.js +0 -543
- data/app/assets/javascripts/src/LoadMask.js +0 -432
- data/app/assets/javascripts/src/ModelManager.js +0 -186
- data/app/assets/javascripts/src/PluginManager.js +0 -110
- data/app/assets/javascripts/src/ProgressBar.js +0 -336
- data/app/assets/javascripts/src/Shadow.js +0 -233
- data/app/assets/javascripts/src/ShadowPool.js +0 -43
- data/app/assets/javascripts/src/Template.js +0 -331
- data/app/assets/javascripts/src/XTemplate.js +0 -365
- data/app/assets/javascripts/src/XTemplateCompiler.js +0 -450
- data/app/assets/javascripts/src/XTemplateParser.js +0 -249
- data/app/assets/javascripts/src/ZIndexManager.js +0 -519
- data/app/assets/javascripts/src/app/Application.js +0 -271
- data/app/assets/javascripts/src/app/Controller.js +0 -458
- data/app/assets/javascripts/src/app/EventBus.js +0 -112
- data/app/assets/javascripts/src/button/Button.js +0 -1483
- data/app/assets/javascripts/src/button/Cycle.js +0 -215
- data/app/assets/javascripts/src/button/Split.js +0 -99
- data/app/assets/javascripts/src/chart/Callout.js +0 -140
- data/app/assets/javascripts/src/chart/Chart.js +0 -966
- data/app/assets/javascripts/src/chart/Highlight.js +0 -172
- data/app/assets/javascripts/src/chart/Label.js +0 -241
- data/app/assets/javascripts/src/chart/Legend.js +0 -474
- data/app/assets/javascripts/src/chart/LegendItem.js +0 -217
- data/app/assets/javascripts/src/chart/Mask.js +0 -230
- data/app/assets/javascripts/src/chart/MaskLayer.js +0 -48
- data/app/assets/javascripts/src/chart/Navigation.js +0 -79
- data/app/assets/javascripts/src/chart/Shape.js +0 -106
- data/app/assets/javascripts/src/chart/Tip.js +0 -98
- data/app/assets/javascripts/src/chart/TipSurface.js +0 -42
- data/app/assets/javascripts/src/chart/axis/Abstract.js +0 -73
- data/app/assets/javascripts/src/chart/axis/Axis.js +0 -961
- data/app/assets/javascripts/src/chart/axis/Category.js +0 -130
- data/app/assets/javascripts/src/chart/axis/Gauge.js +0 -203
- data/app/assets/javascripts/src/chart/axis/Numeric.js +0 -235
- data/app/assets/javascripts/src/chart/axis/Radial.js +0 -204
- data/app/assets/javascripts/src/chart/axis/Time.js +0 -135
- data/app/assets/javascripts/src/chart/series/Area.js +0 -803
- data/app/assets/javascripts/src/chart/series/Bar.js +0 -853
- data/app/assets/javascripts/src/chart/series/Cartesian.js +0 -328
- data/app/assets/javascripts/src/chart/series/Column.js +0 -104
- data/app/assets/javascripts/src/chart/series/Gauge.js +0 -490
- data/app/assets/javascripts/src/chart/series/Line.js +0 -1104
- data/app/assets/javascripts/src/chart/series/Pie.js +0 -1072
- data/app/assets/javascripts/src/chart/series/Radar.js +0 -440
- data/app/assets/javascripts/src/chart/series/Scatter.js +0 -668
- data/app/assets/javascripts/src/chart/series/Series.js +0 -443
- data/app/assets/javascripts/src/chart/theme/Base.js +0 -175
- data/app/assets/javascripts/src/chart/theme/Theme.js +0 -253
- data/app/assets/javascripts/src/container/AbstractContainer.js +0 -1062
- data/app/assets/javascripts/src/container/ButtonGroup.js +0 -143
- data/app/assets/javascripts/src/container/Container.js +0 -212
- data/app/assets/javascripts/src/container/DockingContainer.js +0 -265
- data/app/assets/javascripts/src/container/Viewport.js +0 -184
- data/app/assets/javascripts/src/core/dom/Element.form.js +0 -50
- data/app/assets/javascripts/src/core/dom/Element.static-more.js +0 -159
- data/app/assets/javascripts/src/core/examples/index.html +0 -321
- data/app/assets/javascripts/src/core/examples/index.js +0 -6
- data/app/assets/javascripts/src/core/examples/src/Sample/CTO.js +0 -25
- data/app/assets/javascripts/src/core/examples/src/Sample/CoolGuy.js +0 -20
- data/app/assets/javascripts/src/core/examples/src/Sample/Developer.js +0 -43
- data/app/assets/javascripts/src/core/examples/src/Sample/Gun.js +0 -3
- data/app/assets/javascripts/src/core/examples/src/Sample/HumanResource.js +0 -23
- data/app/assets/javascripts/src/core/examples/src/Sample/Musician.js +0 -20
- data/app/assets/javascripts/src/core/examples/src/Sample/Person.js +0 -50
- data/app/assets/javascripts/src/core/examples/src/Sample/ability/CanComposeSongs.js +0 -9
- data/app/assets/javascripts/src/core/examples/src/Sample/ability/CanPlayGuitar.js +0 -9
- data/app/assets/javascripts/src/core/examples/src/Sample/ability/CanSing.js +0 -18
- data/app/assets/javascripts/src/core/examples/src/Sample/deadlock/A.js +0 -3
- data/app/assets/javascripts/src/core/examples/src/Sample/deadlock/B.js +0 -3
- data/app/assets/javascripts/src/core/examples/src/Sample/deadlock/C.js +0 -3
- data/app/assets/javascripts/src/core/examples/src/Sample/deadlock/D.js +0 -3
- data/app/assets/javascripts/src/core/examples/src/Sample/deadlock/E.js +0 -3
- data/app/assets/javascripts/src/core/examples/src/Sample/notdeadlock/A.js +0 -3
- data/app/assets/javascripts/src/core/examples/src/Sample/notdeadlock/B.js +0 -4
- data/app/assets/javascripts/src/core/examples/src/Sample/notdeadlock/C.js +0 -3
- data/app/assets/javascripts/src/core/src/EventManager.js +0 -1167
- data/app/assets/javascripts/src/core/src/EventObject.js +0 -883
- data/app/assets/javascripts/src/core/src/Ext-more.js +0 -1283
- data/app/assets/javascripts/src/core/src/Ext.js +0 -736
- data/app/assets/javascripts/src/core/src/Support.js +0 -662
- data/app/assets/javascripts/src/core/src/class/Base.js +0 -1085
- data/app/assets/javascripts/src/core/src/class/Class.js +0 -676
- data/app/assets/javascripts/src/core/src/class/ClassManager.js +0 -1591
- data/app/assets/javascripts/src/core/src/class/Loader.js +0 -1423
- data/app/assets/javascripts/src/core/src/dom/AbstractElement.alignment.js +0 -173
- data/app/assets/javascripts/src/core/src/dom/AbstractElement.insertion.js +0 -193
- data/app/assets/javascripts/src/core/src/dom/AbstractElement.js +0 -681
- data/app/assets/javascripts/src/core/src/dom/AbstractElement.position.js +0 -356
- data/app/assets/javascripts/src/core/src/dom/AbstractElement.static.js +0 -474
- data/app/assets/javascripts/src/core/src/dom/AbstractElement.style.js +0 -851
- data/app/assets/javascripts/src/core/src/dom/AbstractElement.traversal.js +0 -180
- data/app/assets/javascripts/src/core/src/dom/AbstractHelper.js +0 -291
- data/app/assets/javascripts/src/core/src/dom/AbstractQuery.js +0 -72
- data/app/assets/javascripts/src/core/src/dom/CompositeElement.js +0 -75
- data/app/assets/javascripts/src/core/src/dom/CompositeElementLite.js +0 -436
- data/app/assets/javascripts/src/core/src/dom/DomQuery-aria.js +0 -1049
- data/app/assets/javascripts/src/core/src/env/Browser.js +0 -186
- data/app/assets/javascripts/src/core/src/env/FeatureDetector.js +0 -274
- data/app/assets/javascripts/src/core/src/env/OS.js +0 -141
- data/app/assets/javascripts/src/core/src/lang/Array.js +0 -1205
- data/app/assets/javascripts/src/core/src/lang/Date.js +0 -1463
- data/app/assets/javascripts/src/core/src/lang/Error.js +0 -326
- data/app/assets/javascripts/src/core/src/lang/Function.js +0 -485
- data/app/assets/javascripts/src/core/src/lang/Number.js +0 -175
- data/app/assets/javascripts/src/core/src/lang/Object.js +0 -606
- data/app/assets/javascripts/src/core/src/lang/String.js +0 -333
- data/app/assets/javascripts/src/core/src/misc/JSON.js +0 -236
- data/app/assets/javascripts/src/core/src/perf/Accumulator.js +0 -244
- data/app/assets/javascripts/src/core/src/perf/Monitor.js +0 -197
- data/app/assets/javascripts/src/core/src/util/DelayedTask.js +0 -71
- data/app/assets/javascripts/src/core/src/util/Event.js +0 -215
- data/app/assets/javascripts/src/core/src/util/Format.js +0 -551
- data/app/assets/javascripts/src/core/src/util/TaskManager.js +0 -417
- data/app/assets/javascripts/src/core/src/version/Version.js +0 -364
- data/app/assets/javascripts/src/core/test/unit/README.MD +0 -91
- data/app/assets/javascripts/src/core/test/unit/bootstrap.js +0 -39
- data/app/assets/javascripts/src/core/test/unit/build/build-data.js +0 -34
- data/app/assets/javascripts/src/core/test/unit/build/build.sh +0 -2
- data/app/assets/javascripts/src/core/test/unit/data.js +0 -27
- data/app/assets/javascripts/src/core/test/unit/index.html +0 -15
- data/app/assets/javascripts/src/core/test/unit/other_specs/dom.html +0 -40
- data/app/assets/javascripts/src/core/test/unit/other_specs/dom/extjs-api.js +0 -12
- data/app/assets/javascripts/src/core/test/unit/other_specs/dom/platform-api.js +0 -134
- data/app/assets/javascripts/src/core/test/unit/other_specs/dom/sanity.js +0 -4
- data/app/assets/javascripts/src/core/test/unit/other_specs/dom/touch-api-out.js +0 -128
- data/app/assets/javascripts/src/core/test/unit/other_specs/dom/touch-api.js +0 -89
- data/app/assets/javascripts/src/core/test/unit/other_specs/env/Environment.js +0 -357
- data/app/assets/javascripts/src/core/test/unit/resources/APITest.js +0 -37
- data/app/assets/javascripts/src/core/test/unit/resources/jsb3.js +0 -14
- data/app/assets/javascripts/src/core/test/unit/resources/test-setup.js +0 -137
- data/app/assets/javascripts/src/core/test/unit/spec/EventManager.js +0 -629
- data/app/assets/javascripts/src/core/test/unit/spec/Ext-mess.backup +0 -198
- data/app/assets/javascripts/src/core/test/unit/spec/Ext-more.js +0 -520
- data/app/assets/javascripts/src/core/test/unit/spec/Ext.js +0 -1550
- data/app/assets/javascripts/src/core/test/unit/spec/Support.js +0 -250
- data/app/assets/javascripts/src/core/test/unit/spec/class/Base.js +0 -47
- data/app/assets/javascripts/src/core/test/unit/spec/class/Class.js +0 -561
- data/app/assets/javascripts/src/core/test/unit/spec/class/ClassManager.js +0 -555
- data/app/assets/javascripts/src/core/test/unit/spec/dom/CompositeElementLite.js +0 -409
- data/app/assets/javascripts/src/core/test/unit/spec/dom/DomHelper.js +0 -444
- data/app/assets/javascripts/src/core/test/unit/spec/dom/Element.insertion.js +0 -342
- data/app/assets/javascripts/src/core/test/unit/spec/dom/Element.js +0 -731
- data/app/assets/javascripts/src/core/test/unit/spec/dom/Element.static.js +0 -201
- data/app/assets/javascripts/src/core/test/unit/spec/dom/Element.style.js +0 -118
- data/app/assets/javascripts/src/core/test/unit/spec/dom/Element.traversal.js +0 -336
- data/app/assets/javascripts/src/core/test/unit/spec/lang/Array.js +0 -1229
- data/app/assets/javascripts/src/core/test/unit/spec/lang/Date.js +0 -697
- data/app/assets/javascripts/src/core/test/unit/spec/lang/Error.js +0 -277
- data/app/assets/javascripts/src/core/test/unit/spec/lang/Function.js +0 -536
- data/app/assets/javascripts/src/core/test/unit/spec/lang/Number.js +0 -323
- data/app/assets/javascripts/src/core/test/unit/spec/lang/Object.js +0 -591
- data/app/assets/javascripts/src/core/test/unit/spec/lang/String.js +0 -451
- data/app/assets/javascripts/src/core/test/unit/spec/misc/JSON.js +0 -252
- data/app/assets/javascripts/src/core/test/unit/spec/util/Format.js +0 -521
- data/app/assets/javascripts/src/core/test/unit/spec/version/Version.js +0 -148
- data/app/assets/javascripts/src/core/test/unit/specs.html +0 -19
- data/app/assets/javascripts/src/data/AbstractStore.js +0 -887
- data/app/assets/javascripts/src/data/ArrayStore.js +0 -74
- data/app/assets/javascripts/src/data/Batch.js +0 -236
- data/app/assets/javascripts/src/data/BufferStore.js +0 -13
- data/app/assets/javascripts/src/data/Connection.js +0 -969
- data/app/assets/javascripts/src/data/DirectStore.js +0 -50
- data/app/assets/javascripts/src/data/Errors.js +0 -52
- data/app/assets/javascripts/src/data/Field.js +0 -341
- data/app/assets/javascripts/src/data/IdGenerator.js +0 -198
- data/app/assets/javascripts/src/data/JsonP.js +0 -253
- data/app/assets/javascripts/src/data/JsonPStore.js +0 -51
- data/app/assets/javascripts/src/data/JsonStore.js +0 -60
- data/app/assets/javascripts/src/data/Model.js +0 -1673
- data/app/assets/javascripts/src/data/NodeInterface.js +0 -1294
- data/app/assets/javascripts/src/data/NodeStore.js +0 -254
- data/app/assets/javascripts/src/data/Operation.js +0 -331
- data/app/assets/javascripts/src/data/Request.js +0 -40
- data/app/assets/javascripts/src/data/ResultSet.js +0 -56
- data/app/assets/javascripts/src/data/SequentialIdGenerator.js +0 -61
- data/app/assets/javascripts/src/data/SortTypes.js +0 -125
- data/app/assets/javascripts/src/data/Store.js +0 -2609
- data/app/assets/javascripts/src/data/StoreManager.js +0 -156
- data/app/assets/javascripts/src/data/Tree.js +0 -290
- data/app/assets/javascripts/src/data/TreeStore.js +0 -655
- data/app/assets/javascripts/src/data/Types.js +0 -190
- data/app/assets/javascripts/src/data/UuidGenerator.js +0 -215
- data/app/assets/javascripts/src/data/XmlStore.js +0 -76
- data/app/assets/javascripts/src/data/association/Association.js +0 -243
- data/app/assets/javascripts/src/data/association/BelongsTo.js +0 -291
- data/app/assets/javascripts/src/data/association/HasMany.js +0 -289
- data/app/assets/javascripts/src/data/association/HasOne.js +0 -304
- data/app/assets/javascripts/src/data/proxy/Ajax.js +0 -282
- data/app/assets/javascripts/src/data/proxy/Client.js +0 -21
- data/app/assets/javascripts/src/data/proxy/Direct.js +0 -181
- data/app/assets/javascripts/src/data/proxy/JsonP.js +0 -313
- data/app/assets/javascripts/src/data/proxy/LocalStorage.js +0 -69
- data/app/assets/javascripts/src/data/proxy/Memory.js +0 -156
- data/app/assets/javascripts/src/data/proxy/Proxy.js +0 -433
- data/app/assets/javascripts/src/data/proxy/Rest.js +0 -173
- data/app/assets/javascripts/src/data/proxy/Server.js +0 -460
- data/app/assets/javascripts/src/data/proxy/SessionStorage.js +0 -39
- data/app/assets/javascripts/src/data/proxy/WebStorage.js +0 -546
- data/app/assets/javascripts/src/data/reader/Array.js +0 -68
- data/app/assets/javascripts/src/data/reader/Json.js +0 -383
- data/app/assets/javascripts/src/data/reader/Reader.js +0 -735
- data/app/assets/javascripts/src/data/reader/Xml.js +0 -292
- data/app/assets/javascripts/src/data/validations.js +0 -149
- data/app/assets/javascripts/src/data/writer/Json.js +0 -81
- data/app/assets/javascripts/src/data/writer/Writer.js +0 -147
- data/app/assets/javascripts/src/data/writer/Xml.js +0 -88
- data/app/assets/javascripts/src/dd/DD.js +0 -300
- data/app/assets/javascripts/src/dd/DDProxy.js +0 -204
- data/app/assets/javascripts/src/dd/DDTarget.js +0 -171
- data/app/assets/javascripts/src/dd/DragDrop.js +0 -1101
- data/app/assets/javascripts/src/dd/DragDropManager.js +0 -1264
- data/app/assets/javascripts/src/dd/DragSource.js +0 -392
- data/app/assets/javascripts/src/dd/DragTracker.js +0 -562
- data/app/assets/javascripts/src/dd/DragZone.js +0 -137
- data/app/assets/javascripts/src/dd/DropTarget.js +0 -118
- data/app/assets/javascripts/src/dd/DropZone.js +0 -254
- data/app/assets/javascripts/src/dd/Registry.js +0 -117
- data/app/assets/javascripts/src/dd/ScrollManager.js +0 -218
- data/app/assets/javascripts/src/dd/StatusProxy.js +0 -179
- data/app/assets/javascripts/src/diag/layout/Context.js +0 -523
- data/app/assets/javascripts/src/diag/layout/ContextItem.js +0 -179
- data/app/assets/javascripts/src/direct/Event.js +0 -35
- data/app/assets/javascripts/src/direct/ExceptionEvent.js +0 -16
- data/app/assets/javascripts/src/direct/JsonProvider.js +0 -82
- data/app/assets/javascripts/src/direct/Manager.js +0 -263
- data/app/assets/javascripts/src/direct/PollingProvider.js +0 -156
- data/app/assets/javascripts/src/direct/Provider.js +0 -96
- data/app/assets/javascripts/src/direct/RemotingEvent.js +0 -24
- data/app/assets/javascripts/src/direct/RemotingMethod.js +0 -100
- data/app/assets/javascripts/src/direct/RemotingProvider.js +0 -510
- data/app/assets/javascripts/src/direct/Transaction.js +0 -41
- data/app/assets/javascripts/src/dom/Element.alignment.js +0 -378
- data/app/assets/javascripts/src/dom/Element.anim.js +0 -962
- data/app/assets/javascripts/src/dom/Element.dd.js +0 -40
- data/app/assets/javascripts/src/dom/Element.fx.js +0 -194
- data/app/assets/javascripts/src/dom/Element.js +0 -1407
- data/app/assets/javascripts/src/dom/Element.position.js +0 -501
- data/app/assets/javascripts/src/dom/Element.scroll.js +0 -214
- data/app/assets/javascripts/src/dom/Element.style.js +0 -792
- data/app/assets/javascripts/src/dom/Element.traversal.js +0 -8
- data/app/assets/javascripts/src/dom/Helper.js +0 -466
- data/app/assets/javascripts/src/dom/Query.js +0 -1067
- data/app/assets/javascripts/src/draw/Color.js +0 -303
- data/app/assets/javascripts/src/draw/Component.js +0 -245
- data/app/assets/javascripts/src/draw/CompositeSprite.js +0 -299
- data/app/assets/javascripts/src/draw/Draw.js +0 -1217
- data/app/assets/javascripts/src/draw/Matrix.js +0 -183
- data/app/assets/javascripts/src/draw/Sprite.js +0 -554
- data/app/assets/javascripts/src/draw/SpriteDD.js +0 -87
- data/app/assets/javascripts/src/draw/Surface.js +0 -1001
- data/app/assets/javascripts/src/draw/Text.js +0 -175
- data/app/assets/javascripts/src/draw/engine/ImageExporter.js +0 -106
- data/app/assets/javascripts/src/draw/engine/Svg.js +0 -734
- data/app/assets/javascripts/src/draw/engine/SvgExporter.js +0 -280
- data/app/assets/javascripts/src/draw/engine/Vml.js +0 -916
- data/app/assets/javascripts/src/flash/Component.js +0 -248
- data/app/assets/javascripts/src/form/Basic.js +0 -1018
- data/app/assets/javascripts/src/form/CheckboxGroup.js +0 -441
- data/app/assets/javascripts/src/form/CheckboxManager.js +0 -26
- data/app/assets/javascripts/src/form/FieldAncestor.js +0 -210
- data/app/assets/javascripts/src/form/FieldContainer.js +0 -290
- data/app/assets/javascripts/src/form/FieldSet.js +0 -506
- data/app/assets/javascripts/src/form/Label.js +0 -110
- data/app/assets/javascripts/src/form/Labelable.js +0 -764
- data/app/assets/javascripts/src/form/Panel.js +0 -335
- data/app/assets/javascripts/src/form/RadioGroup.js +0 -124
- data/app/assets/javascripts/src/form/RadioManager.js +0 -26
- data/app/assets/javascripts/src/form/action/Action.js +0 -307
- data/app/assets/javascripts/src/form/action/DirectLoad.js +0 -107
- data/app/assets/javascripts/src/form/action/DirectSubmit.js +0 -119
- data/app/assets/javascripts/src/form/action/Load.js +0 -120
- data/app/assets/javascripts/src/form/action/StandardSubmit.js +0 -34
- data/app/assets/javascripts/src/form/action/Submit.js +0 -257
- data/app/assets/javascripts/src/form/field/Base.js +0 -813
- data/app/assets/javascripts/src/form/field/Checkbox.js +0 -505
- data/app/assets/javascripts/src/form/field/ComboBox.js +0 -1427
- data/app/assets/javascripts/src/form/field/Date.js +0 -578
- data/app/assets/javascripts/src/form/field/Display.js +0 -155
- data/app/assets/javascripts/src/form/field/Field.js +0 -430
- data/app/assets/javascripts/src/form/field/File.js +0 -265
- data/app/assets/javascripts/src/form/field/Hidden.js +0 -75
- data/app/assets/javascripts/src/form/field/HtmlEditor.js +0 -1439
- data/app/assets/javascripts/src/form/field/Number.js +0 -380
- data/app/assets/javascripts/src/form/field/Picker.js +0 -321
- data/app/assets/javascripts/src/form/field/Radio.js +0 -279
- data/app/assets/javascripts/src/form/field/Spinner.js +0 -321
- data/app/assets/javascripts/src/form/field/Text.js +0 -727
- data/app/assets/javascripts/src/form/field/TextArea.js +0 -228
- data/app/assets/javascripts/src/form/field/Time.js +0 -459
- data/app/assets/javascripts/src/form/field/Trigger.js +0 -469
- data/app/assets/javascripts/src/form/field/VTypes.js +0 -172
- data/app/assets/javascripts/src/fx/Anim.js +0 -472
- data/app/assets/javascripts/src/fx/Animator.js +0 -410
- data/app/assets/javascripts/src/fx/CubicBezier.js +0 -77
- data/app/assets/javascripts/src/fx/Easing.js +0 -136
- data/app/assets/javascripts/src/fx/Manager.js +0 -353
- data/app/assets/javascripts/src/fx/PropertyHandler.js +0 -381
- data/app/assets/javascripts/src/fx/Queue.js +0 -123
- data/app/assets/javascripts/src/fx/target/Component.js +0 -118
- data/app/assets/javascripts/src/fx/target/CompositeElement.js +0 -46
- data/app/assets/javascripts/src/fx/target/CompositeElementCSS.js +0 -22
- data/app/assets/javascripts/src/fx/target/CompositeSprite.js +0 -34
- data/app/assets/javascripts/src/fx/target/Element.js +0 -83
- data/app/assets/javascripts/src/fx/target/ElementCSS.js +0 -77
- data/app/assets/javascripts/src/fx/target/Sprite.js +0 -128
- data/app/assets/javascripts/src/fx/target/Target.js +0 -36
- data/app/assets/javascripts/src/grid/CellEditor.js +0 -172
- data/app/assets/javascripts/src/grid/ColumnComponentLayout.js +0 -34
- data/app/assets/javascripts/src/grid/ColumnLayout.js +0 -201
- data/app/assets/javascripts/src/grid/Lockable.js +0 -863
- data/app/assets/javascripts/src/grid/LockingView.js +0 -169
- data/app/assets/javascripts/src/grid/PagingScroller.js +0 -539
- data/app/assets/javascripts/src/grid/Panel.js +0 -393
- data/app/assets/javascripts/src/grid/RowEditor.js +0 -731
- data/app/assets/javascripts/src/grid/RowNumberer.js +0 -76
- data/app/assets/javascripts/src/grid/Scroller.js +0 -5
- data/app/assets/javascripts/src/grid/View.js +0 -44
- data/app/assets/javascripts/src/grid/ViewDropZone.js +0 -41
- data/app/assets/javascripts/src/grid/column/Action.js +0 -318
- data/app/assets/javascripts/src/grid/column/Boolean.js +0 -82
- data/app/assets/javascripts/src/grid/column/Column.js +0 -835
- data/app/assets/javascripts/src/grid/column/Date.js +0 -63
- data/app/assets/javascripts/src/grid/column/Number.js +0 -52
- data/app/assets/javascripts/src/grid/column/Template.js +0 -58
- data/app/assets/javascripts/src/grid/feature/AbstractSummary.js +0 -154
- data/app/assets/javascripts/src/grid/feature/Chunking.js +0 -77
- data/app/assets/javascripts/src/grid/feature/Feature.js +0 -158
- data/app/assets/javascripts/src/grid/feature/Grouping.js +0 -822
- data/app/assets/javascripts/src/grid/feature/GroupingSummary.js +0 -243
- data/app/assets/javascripts/src/grid/feature/RowBody.js +0 -116
- data/app/assets/javascripts/src/grid/feature/RowWrap.js +0 -120
- data/app/assets/javascripts/src/grid/feature/Summary.js +0 -167
- data/app/assets/javascripts/src/grid/header/Container.js +0 -965
- data/app/assets/javascripts/src/grid/header/DragZone.js +0 -69
- data/app/assets/javascripts/src/grid/header/DropZone.js +0 -265
- data/app/assets/javascripts/src/grid/plugin/CellEditing.js +0 -453
- data/app/assets/javascripts/src/grid/plugin/DragDrop.js +0 -254
- data/app/assets/javascripts/src/grid/plugin/Editing.js +0 -561
- data/app/assets/javascripts/src/grid/plugin/HeaderReorderer.js +0 -49
- data/app/assets/javascripts/src/grid/plugin/HeaderResizer.js +0 -292
- data/app/assets/javascripts/src/grid/plugin/RowEditing.js +0 -339
- data/app/assets/javascripts/src/grid/property/Grid.js +0 -351
- data/app/assets/javascripts/src/grid/property/HeaderContainer.js +0 -109
- data/app/assets/javascripts/src/grid/property/Property.js +0 -36
- data/app/assets/javascripts/src/grid/property/Store.js +0 -141
- data/app/assets/javascripts/src/layout/ClassList.js +0 -90
- data/app/assets/javascripts/src/layout/Context.js +0 -1232
- data/app/assets/javascripts/src/layout/ContextItem.js +0 -1470
- data/app/assets/javascripts/src/layout/Layout.js +0 -761
- data/app/assets/javascripts/src/layout/component/Auto.js +0 -220
- data/app/assets/javascripts/src/layout/component/Body.js +0 -80
- data/app/assets/javascripts/src/layout/component/BoundList.js +0 -95
- data/app/assets/javascripts/src/layout/component/Button.js +0 -261
- data/app/assets/javascripts/src/layout/component/Component.js +0 -427
- data/app/assets/javascripts/src/layout/component/Dock.js +0 -1132
- data/app/assets/javascripts/src/layout/component/Draw.js +0 -79
- data/app/assets/javascripts/src/layout/component/FieldSet.js +0 -62
- data/app/assets/javascripts/src/layout/component/ProgressBar.js +0 -54
- data/app/assets/javascripts/src/layout/component/Tab.js +0 -23
- data/app/assets/javascripts/src/layout/component/field/ComboBox.js +0 -52
- data/app/assets/javascripts/src/layout/component/field/Field.js +0 -372
- data/app/assets/javascripts/src/layout/component/field/FieldContainer.js +0 -48
- data/app/assets/javascripts/src/layout/component/field/HtmlEditor.js +0 -54
- data/app/assets/javascripts/src/layout/component/field/Slider.js +0 -58
- data/app/assets/javascripts/src/layout/component/field/Text.js +0 -75
- data/app/assets/javascripts/src/layout/component/field/TextArea.js +0 -51
- data/app/assets/javascripts/src/layout/component/field/Trigger.js +0 -132
- data/app/assets/javascripts/src/layout/container/Absolute.js +0 -121
- data/app/assets/javascripts/src/layout/container/Accordion.js +0 -308
- data/app/assets/javascripts/src/layout/container/Anchor.js +0 -403
- data/app/assets/javascripts/src/layout/container/Auto.js +0 -70
- data/app/assets/javascripts/src/layout/container/Border-old-js +0 -1079
- data/app/assets/javascripts/src/layout/container/Border.js +0 -816
- data/app/assets/javascripts/src/layout/container/Box.js +0 -929
- data/app/assets/javascripts/src/layout/container/Card.js +0 -361
- data/app/assets/javascripts/src/layout/container/CheckboxGroup.js +0 -376
- data/app/assets/javascripts/src/layout/container/Column.js +0 -234
- data/app/assets/javascripts/src/layout/container/Container.js +0 -961
- data/app/assets/javascripts/src/layout/container/Editor.js +0 -74
- data/app/assets/javascripts/src/layout/container/Fit.js +0 -287
- data/app/assets/javascripts/src/layout/container/Form.js +0 -157
- data/app/assets/javascripts/src/layout/container/HBox.js +0 -134
- data/app/assets/javascripts/src/layout/container/Table.js +0 -412
- data/app/assets/javascripts/src/layout/container/VBox.js +0 -139
- data/app/assets/javascripts/src/layout/container/boxOverflow/Menu.js +0 -365
- data/app/assets/javascripts/src/layout/container/boxOverflow/None.js +0 -83
- data/app/assets/javascripts/src/layout/container/boxOverflow/Scroller.js +0 -475
- data/app/assets/javascripts/src/menu/CheckItem.js +0 -169
- data/app/assets/javascripts/src/menu/ColorPicker.js +0 -110
- data/app/assets/javascripts/src/menu/DatePicker.js +0 -100
- data/app/assets/javascripts/src/menu/Item.js +0 -553
- data/app/assets/javascripts/src/menu/KeyNav.js +0 -134
- data/app/assets/javascripts/src/menu/Manager.js +0 -219
- data/app/assets/javascripts/src/menu/Menu.js +0 -579
- data/app/assets/javascripts/src/menu/Separator.js +0 -126
- data/app/assets/javascripts/src/panel/AbstractPanel.js +0 -323
- data/app/assets/javascripts/src/panel/DD.js +0 -99
- data/app/assets/javascripts/src/panel/Header.js +0 -518
- data/app/assets/javascripts/src/panel/Panel.js +0 -2150
- data/app/assets/javascripts/src/panel/Proxy.js +0 -131
- data/app/assets/javascripts/src/panel/Table.js +0 -1018
- data/app/assets/javascripts/src/panel/Tool.js +0 -304
- data/app/assets/javascripts/src/picker/Color.js +0 -219
- data/app/assets/javascripts/src/picker/Date.js +0 -1140
- data/app/assets/javascripts/src/picker/Month.js +0 -490
- data/app/assets/javascripts/src/picker/Time.js +0 -165
- data/app/assets/javascripts/src/resizer/BorderSplitter.js +0 -22
- data/app/assets/javascripts/src/resizer/BorderSplitterTracker.js +0 -210
- data/app/assets/javascripts/src/resizer/Handle.js +0 -29
- data/app/assets/javascripts/src/resizer/ResizeTracker.js +0 -346
- data/app/assets/javascripts/src/resizer/Resizer.js +0 -477
- data/app/assets/javascripts/src/resizer/Splitter.js +0 -242
- data/app/assets/javascripts/src/resizer/SplitterTracker.js +0 -230
- data/app/assets/javascripts/src/selection/CellModel.js +0 -395
- data/app/assets/javascripts/src/selection/CheckboxModel.js +0 -234
- data/app/assets/javascripts/src/selection/DataViewModel.js +0 -160
- data/app/assets/javascripts/src/selection/Model.js +0 -646
- data/app/assets/javascripts/src/selection/RowModel.js +0 -499
- data/app/assets/javascripts/src/selection/TreeModel.js +0 -78
- data/app/assets/javascripts/src/slider/Multi.js +0 -835
- data/app/assets/javascripts/src/slider/Single.js +0 -56
- data/app/assets/javascripts/src/slider/Thumb.js +0 -259
- data/app/assets/javascripts/src/slider/Tip.js +0 -130
- data/app/assets/javascripts/src/state/CookieProvider.js +0 -120
- data/app/assets/javascripts/src/state/LocalStorageProvider.js +0 -72
- data/app/assets/javascripts/src/state/Manager.js +0 -70
- data/app/assets/javascripts/src/state/Provider.js +0 -182
- data/app/assets/javascripts/src/state/Stateful.js +0 -364
- data/app/assets/javascripts/src/tab/Bar.js +0 -258
- data/app/assets/javascripts/src/tab/Panel.js +0 -654
- data/app/assets/javascripts/src/tab/Tab.js +0 -358
- data/app/assets/javascripts/src/tail.js +0 -10
- data/app/assets/javascripts/src/tip/QuickTip.js +0 -335
- data/app/assets/javascripts/src/tip/QuickTipManager.js +0 -239
- data/app/assets/javascripts/src/tip/Tip.js +0 -160
- data/app/assets/javascripts/src/tip/ToolTip.js +0 -691
- data/app/assets/javascripts/src/toolbar/Fill.js +0 -28
- data/app/assets/javascripts/src/toolbar/Item.js +0 -16
- data/app/assets/javascripts/src/toolbar/Paging.js +0 -600
- data/app/assets/javascripts/src/toolbar/Separator.js +0 -23
- data/app/assets/javascripts/src/toolbar/Spacer.js +0 -33
- data/app/assets/javascripts/src/toolbar/TextItem.js +0 -57
- data/app/assets/javascripts/src/toolbar/Toolbar-legacy.js +0 -123
- data/app/assets/javascripts/src/toolbar/Toolbar.js +0 -447
- data/app/assets/javascripts/src/tree/Column.js +0 -90
- data/app/assets/javascripts/src/tree/Panel.js +0 -505
- data/app/assets/javascripts/src/tree/View.js +0 -658
- data/app/assets/javascripts/src/tree/ViewDragZone.js +0 -49
- data/app/assets/javascripts/src/tree/ViewDropZone.js +0 -287
- data/app/assets/javascripts/src/tree/plugin/TreeViewDragDrop.js +0 -244
- data/app/assets/javascripts/src/util/AbstractMixedCollection.js +0 -772
- data/app/assets/javascripts/src/util/Animate.js +0 -426
- data/app/assets/javascripts/src/util/Bindable.js +0 -102
- data/app/assets/javascripts/src/util/CSS.js +0 -185
- data/app/assets/javascripts/src/util/ClickRepeater.js +0 -238
- data/app/assets/javascripts/src/util/ComponentDragger.js +0 -126
- data/app/assets/javascripts/src/util/Cookies.js +0 -91
- data/app/assets/javascripts/src/util/ElementContainer.js +0 -293
- data/app/assets/javascripts/src/util/Filter.js +0 -159
- data/app/assets/javascripts/src/util/Floating.js +0 -321
- data/app/assets/javascripts/src/util/Grouper.js +0 -26
- data/app/assets/javascripts/src/util/HashMap.js +0 -356
- data/app/assets/javascripts/src/util/History.js +0 -285
- data/app/assets/javascripts/src/util/Inflector.js +0 -297
- data/app/assets/javascripts/src/util/KeyMap.js +0 -427
- data/app/assets/javascripts/src/util/KeyNav.js +0 -239
- data/app/assets/javascripts/src/util/LruCache.js +0 -257
- data/app/assets/javascripts/src/util/Memento.js +0 -131
- data/app/assets/javascripts/src/util/MixedCollection.js +0 -239
- data/app/assets/javascripts/src/util/Observable.js +0 -1003
- data/app/assets/javascripts/src/util/Offset.js +0 -60
- data/app/assets/javascripts/src/util/Point.js +0 -93
- data/app/assets/javascripts/src/util/ProtoElement.js +0 -205
- data/app/assets/javascripts/src/util/Queue.js +0 -76
- data/app/assets/javascripts/src/util/Region.js +0 -388
- data/app/assets/javascripts/src/util/Renderable.js +0 -1079
- data/app/assets/javascripts/src/util/Sortable.js +0 -248
- data/app/assets/javascripts/src/util/Sorter.js +0 -179
- data/app/assets/javascripts/src/util/TextMetrics.js +0 -148
- data/app/assets/javascripts/src/view/AbstractView.js +0 -1103
- data/app/assets/javascripts/src/view/BoundList.js +0 -207
- data/app/assets/javascripts/src/view/BoundListKeyNav.js +0 -92
- data/app/assets/javascripts/src/view/DragZone.js +0 -106
- data/app/assets/javascripts/src/view/DropZone.js +0 -240
- data/app/assets/javascripts/src/view/Table.js +0 -1229
- data/app/assets/javascripts/src/view/TableChunker.js +0 -139
- data/app/assets/javascripts/src/view/View.js +0 -636
- data/app/assets/javascripts/src/window/MessageBox.js +0 -880
- data/app/assets/javascripts/src/window/Window-legacy.js +0 -56
- data/app/assets/javascripts/src/window/Window.js +0 -793
@@ -1,289 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* @author Ed Spencer
|
3
|
-
* @class Ext.data.association.HasMany
|
4
|
-
*
|
5
|
-
* <p>Represents a one-to-many relationship between two models. Usually created indirectly via a model definition:</p>
|
6
|
-
*
|
7
|
-
<pre><code>
|
8
|
-
Ext.define('Product', {
|
9
|
-
extend: 'Ext.data.Model',
|
10
|
-
fields: [
|
11
|
-
{name: 'id', type: 'int'},
|
12
|
-
{name: 'user_id', type: 'int'},
|
13
|
-
{name: 'name', type: 'string'}
|
14
|
-
]
|
15
|
-
});
|
16
|
-
|
17
|
-
Ext.define('User', {
|
18
|
-
extend: 'Ext.data.Model',
|
19
|
-
fields: [
|
20
|
-
{name: 'id', type: 'int'},
|
21
|
-
{name: 'name', type: 'string'}
|
22
|
-
],
|
23
|
-
// we can use the hasMany shortcut on the model to create a hasMany association
|
24
|
-
hasMany: {model: 'Product', name: 'products'}
|
25
|
-
});
|
26
|
-
</pre></code>
|
27
|
-
*
|
28
|
-
* <p>Above we created Product and User models, and linked them by saying that a User hasMany Products. This gives
|
29
|
-
* us a new function on every User instance, in this case the function is called 'products' because that is the name
|
30
|
-
* we specified in the association configuration above.</p>
|
31
|
-
*
|
32
|
-
* <p>This new function returns a specialized {@link Ext.data.Store Store} which is automatically filtered to load
|
33
|
-
* only Products for the given model instance:</p>
|
34
|
-
*
|
35
|
-
<pre><code>
|
36
|
-
//first, we load up a User with id of 1
|
37
|
-
var user = Ext.create('User', {id: 1, name: 'Ed'});
|
38
|
-
|
39
|
-
//the user.products function was created automatically by the association and returns a {@link Ext.data.Store Store}
|
40
|
-
//the created store is automatically scoped to the set of Products for the User with id of 1
|
41
|
-
var products = user.products();
|
42
|
-
|
43
|
-
//we still have all of the usual Store functions, for example it's easy to add a Product for this User
|
44
|
-
products.add({
|
45
|
-
name: 'Another Product'
|
46
|
-
});
|
47
|
-
|
48
|
-
//saves the changes to the store - this automatically sets the new Product's user_id to 1 before saving
|
49
|
-
products.sync();
|
50
|
-
</code></pre>
|
51
|
-
*
|
52
|
-
* <p>The new Store is only instantiated the first time you call products() to conserve memory and processing time,
|
53
|
-
* though calling products() a second time returns the same store instance.</p>
|
54
|
-
*
|
55
|
-
* <p><u>Custom filtering</u></p>
|
56
|
-
*
|
57
|
-
* <p>The Store is automatically furnished with a filter - by default this filter tells the store to only return
|
58
|
-
* records where the associated model's foreign key matches the owner model's primary key. For example, if a User
|
59
|
-
* with ID = 100 hasMany Products, the filter loads only Products with user_id == 100.</p>
|
60
|
-
*
|
61
|
-
* <p>Sometimes we want to filter by another field - for example in the case of a Twitter search application we may
|
62
|
-
* have models for Search and Tweet:</p>
|
63
|
-
*
|
64
|
-
<pre><code>
|
65
|
-
Ext.define('Search', {
|
66
|
-
extend: 'Ext.data.Model',
|
67
|
-
fields: [
|
68
|
-
'id', 'query'
|
69
|
-
],
|
70
|
-
|
71
|
-
hasMany: {
|
72
|
-
model: 'Tweet',
|
73
|
-
name : 'tweets',
|
74
|
-
filterProperty: 'query'
|
75
|
-
}
|
76
|
-
});
|
77
|
-
|
78
|
-
Ext.define('Tweet', {
|
79
|
-
extend: 'Ext.data.Model',
|
80
|
-
fields: [
|
81
|
-
'id', 'text', 'from_user'
|
82
|
-
]
|
83
|
-
});
|
84
|
-
|
85
|
-
//returns a Store filtered by the filterProperty
|
86
|
-
var store = new Search({query: 'Sencha Touch'}).tweets();
|
87
|
-
</code></pre>
|
88
|
-
*
|
89
|
-
* <p>The tweets association above is filtered by the query property by setting the {@link #filterProperty}, and is
|
90
|
-
* equivalent to this:</p>
|
91
|
-
*
|
92
|
-
<pre><code>
|
93
|
-
var store = Ext.create('Ext.data.Store', {
|
94
|
-
model: 'Tweet',
|
95
|
-
filters: [
|
96
|
-
{
|
97
|
-
property: 'query',
|
98
|
-
value : 'Sencha Touch'
|
99
|
-
}
|
100
|
-
]
|
101
|
-
});
|
102
|
-
</code></pre>
|
103
|
-
*/
|
104
|
-
Ext.define('Ext.data.association.HasMany', {
|
105
|
-
extend: 'Ext.data.association.Association',
|
106
|
-
alternateClassName: 'Ext.data.HasManyAssociation',
|
107
|
-
requires: ['Ext.util.Inflector'],
|
108
|
-
|
109
|
-
alias: 'association.hasmany',
|
110
|
-
|
111
|
-
/**
|
112
|
-
* @cfg {String} foreignKey The name of the foreign key on the associated model that links it to the owner
|
113
|
-
* model. Defaults to the lowercased name of the owner model plus "_id", e.g. an association with a where a
|
114
|
-
* model called Group hasMany Users would create 'group_id' as the foreign key. When the remote store is loaded,
|
115
|
-
* the store is automatically filtered so that only records with a matching foreign key are included in the
|
116
|
-
* resulting child store. This can be overridden by specifying the {@link #filterProperty}.
|
117
|
-
* <pre><code>
|
118
|
-
Ext.define('Group', {
|
119
|
-
extend: 'Ext.data.Model',
|
120
|
-
fields: ['id', 'name'],
|
121
|
-
hasMany: 'User'
|
122
|
-
});
|
123
|
-
|
124
|
-
Ext.define('User', {
|
125
|
-
extend: 'Ext.data.Model',
|
126
|
-
fields: ['id', 'name', 'group_id'], // refers to the id of the group that this user belongs to
|
127
|
-
belongsTo: 'Group'
|
128
|
-
});
|
129
|
-
* </code></pre>
|
130
|
-
*/
|
131
|
-
|
132
|
-
/**
|
133
|
-
* @cfg {String} name The name of the function to create on the owner model to retrieve the child store.
|
134
|
-
* If not specified, the pluralized name of the child model is used.
|
135
|
-
* <pre><code>
|
136
|
-
// This will create a users() method on any Group model instance
|
137
|
-
Ext.define('Group', {
|
138
|
-
extend: 'Ext.data.Model',
|
139
|
-
fields: ['id', 'name'],
|
140
|
-
hasMany: 'User'
|
141
|
-
});
|
142
|
-
var group = new Group();
|
143
|
-
console.log(group.users());
|
144
|
-
|
145
|
-
// The method to retrieve the users will now be getUserList
|
146
|
-
Ext.define('Group', {
|
147
|
-
extend: 'Ext.data.Model',
|
148
|
-
fields: ['id', 'name'],
|
149
|
-
hasMany: {model: 'User', name: 'getUserList'}
|
150
|
-
});
|
151
|
-
var group = new Group();
|
152
|
-
console.log(group.getUserList());
|
153
|
-
* </code></pre>
|
154
|
-
*/
|
155
|
-
|
156
|
-
/**
|
157
|
-
* @cfg {Object} storeConfig Optional configuration object that will be passed to the generated Store. Defaults to
|
158
|
-
* undefined.
|
159
|
-
*/
|
160
|
-
|
161
|
-
/**
|
162
|
-
* @cfg {String} filterProperty Optionally overrides the default filter that is set up on the associated Store. If
|
163
|
-
* this is not set, a filter is automatically created which filters the association based on the configured
|
164
|
-
* {@link #foreignKey}. See intro docs for more details. Defaults to undefined
|
165
|
-
*/
|
166
|
-
|
167
|
-
/**
|
168
|
-
* @cfg {Boolean} autoLoad True to automatically load the related store from a remote source when instantiated.
|
169
|
-
* Defaults to <tt>false</tt>.
|
170
|
-
*/
|
171
|
-
|
172
|
-
/**
|
173
|
-
* @cfg {String} type The type configuration can be used when creating associations using a configuration object.
|
174
|
-
* Use 'hasMany' to create a HasMany association
|
175
|
-
* <pre><code>
|
176
|
-
associations: [{
|
177
|
-
type: 'hasMany',
|
178
|
-
model: 'User'
|
179
|
-
}]
|
180
|
-
* </code></pre>
|
181
|
-
*/
|
182
|
-
|
183
|
-
constructor: function(config) {
|
184
|
-
var me = this,
|
185
|
-
ownerProto,
|
186
|
-
name;
|
187
|
-
|
188
|
-
me.callParent(arguments);
|
189
|
-
|
190
|
-
me.name = me.name || Ext.util.Inflector.pluralize(me.associatedName.toLowerCase());
|
191
|
-
|
192
|
-
ownerProto = me.ownerModel.prototype;
|
193
|
-
name = me.name;
|
194
|
-
|
195
|
-
Ext.applyIf(me, {
|
196
|
-
storeName : name + "Store",
|
197
|
-
foreignKey: me.ownerName.toLowerCase() + "_id"
|
198
|
-
});
|
199
|
-
|
200
|
-
ownerProto[name] = me.createStore();
|
201
|
-
},
|
202
|
-
|
203
|
-
/**
|
204
|
-
* @private
|
205
|
-
* Creates a function that returns an Ext.data.Store which is configured to load a set of data filtered
|
206
|
-
* by the owner model's primary key - e.g. in a hasMany association where Group hasMany Users, this function
|
207
|
-
* returns a Store configured to return the filtered set of a single Group's Users.
|
208
|
-
* @return {Function} The store-generating function
|
209
|
-
*/
|
210
|
-
createStore: function() {
|
211
|
-
var that = this,
|
212
|
-
associatedModel = that.associatedModel,
|
213
|
-
storeName = that.storeName,
|
214
|
-
foreignKey = that.foreignKey,
|
215
|
-
primaryKey = that.primaryKey,
|
216
|
-
filterProperty = that.filterProperty,
|
217
|
-
autoLoad = that.autoLoad,
|
218
|
-
storeConfig = that.storeConfig || {};
|
219
|
-
|
220
|
-
return function() {
|
221
|
-
var me = this,
|
222
|
-
config, filter,
|
223
|
-
modelDefaults = {};
|
224
|
-
|
225
|
-
if (me[storeName] === undefined) {
|
226
|
-
if (filterProperty) {
|
227
|
-
filter = {
|
228
|
-
property : filterProperty,
|
229
|
-
value : me.get(filterProperty),
|
230
|
-
exactMatch: true
|
231
|
-
};
|
232
|
-
} else {
|
233
|
-
filter = {
|
234
|
-
property : foreignKey,
|
235
|
-
value : me.get(primaryKey),
|
236
|
-
exactMatch: true
|
237
|
-
};
|
238
|
-
}
|
239
|
-
|
240
|
-
modelDefaults[foreignKey] = me.get(primaryKey);
|
241
|
-
|
242
|
-
config = Ext.apply({}, storeConfig, {
|
243
|
-
model : associatedModel,
|
244
|
-
filters : [filter],
|
245
|
-
remoteFilter : false,
|
246
|
-
modelDefaults: modelDefaults
|
247
|
-
});
|
248
|
-
|
249
|
-
me[storeName] = new Ext.data.Store(config);
|
250
|
-
if (autoLoad) {
|
251
|
-
me[storeName].load();
|
252
|
-
}
|
253
|
-
}
|
254
|
-
|
255
|
-
return me[storeName];
|
256
|
-
};
|
257
|
-
},
|
258
|
-
|
259
|
-
/**
|
260
|
-
* Read associated data
|
261
|
-
* @private
|
262
|
-
* @param {Ext.data.Model} record The record we're writing to
|
263
|
-
* @param {Ext.data.reader.Reader} reader The reader for the associated model
|
264
|
-
* @param {Object} associationData The raw associated data
|
265
|
-
*/
|
266
|
-
read: function(record, reader, associationData){
|
267
|
-
var store = record[this.name](),
|
268
|
-
inverse,
|
269
|
-
items, iLen, i;
|
270
|
-
|
271
|
-
store.add(reader.read(associationData).records);
|
272
|
-
|
273
|
-
//now that we've added the related records to the hasMany association, set the inverse belongsTo
|
274
|
-
//association on each of them if it exists
|
275
|
-
inverse = this.associatedModel.prototype.associations.findBy(function(assoc){
|
276
|
-
return assoc.type === 'belongsTo' && assoc.associatedName === record.$className;
|
277
|
-
});
|
278
|
-
|
279
|
-
//if the inverse association was found, set it now on each record we've just created
|
280
|
-
if (inverse) {
|
281
|
-
items = store.data.items;
|
282
|
-
iLen = items.length;
|
283
|
-
|
284
|
-
for (i = 0; i < iLen; i++) {
|
285
|
-
items[i][inverse.instanceName] = record;
|
286
|
-
}
|
287
|
-
}
|
288
|
-
}
|
289
|
-
});
|
@@ -1,304 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* @class Ext.data.association.HasOne
|
3
|
-
*
|
4
|
-
* Represents a one to one association with another model. The owner model is expected to have
|
5
|
-
* a foreign key which references the primary key of the associated model:
|
6
|
-
*
|
7
|
-
* Ext.define('Address', {
|
8
|
-
* extend: 'Ext.data.Model',
|
9
|
-
* fields: [
|
10
|
-
* { name: 'id', type: 'int' },
|
11
|
-
* { name: 'number', type: 'string' },
|
12
|
-
* { name: 'street', type: 'string' },
|
13
|
-
* { name: 'city', type: 'string' },
|
14
|
-
* { name: 'zip', type: 'string' },
|
15
|
-
* ]
|
16
|
-
* });
|
17
|
-
*
|
18
|
-
* Ext.define('Person', {
|
19
|
-
* extend: 'Ext.data.Model',
|
20
|
-
* fields: [
|
21
|
-
* { name: 'id', type: 'int' },
|
22
|
-
* { name: 'name', type: 'string' },
|
23
|
-
* { name: 'address_id', type: 'int'}
|
24
|
-
* ],
|
25
|
-
* // we can use the hasOne shortcut on the model to create a hasOne association
|
26
|
-
* associations: { type: 'hasOne', model: 'Address' }
|
27
|
-
* });
|
28
|
-
*
|
29
|
-
* In the example above we have created models for People and Addresses, and linked them together
|
30
|
-
* by saying that each Person has a single Address. This automatically links each Person to an Address
|
31
|
-
* based on the Persons address_id, and provides new functions on the Person model:
|
32
|
-
*
|
33
|
-
* ## Generated getter function
|
34
|
-
*
|
35
|
-
* The first function that is added to the owner model is a getter function:
|
36
|
-
*
|
37
|
-
* var person = new Person({
|
38
|
-
* id: 100,
|
39
|
-
* address_id: 20,
|
40
|
-
* name: 'John Smith'
|
41
|
-
* });
|
42
|
-
*
|
43
|
-
* person.getAddress(function(address, operation) {
|
44
|
-
* // do something with the address object
|
45
|
-
* alert(address.get('id')); // alerts 20
|
46
|
-
* }, this);
|
47
|
-
*
|
48
|
-
* The getAddress function was created on the Person model when we defined the association. This uses the
|
49
|
-
* Persons configured {@link Ext.data.proxy.Proxy proxy} to load the Address asynchronously, calling the provided
|
50
|
-
* callback when it has loaded.
|
51
|
-
*
|
52
|
-
* The new getAddress function will also accept an object containing success, failure and callback properties
|
53
|
-
* - callback will always be called, success will only be called if the associated model was loaded successfully
|
54
|
-
* and failure will only be called if the associatied model could not be loaded:
|
55
|
-
*
|
56
|
-
* person.getAddress({
|
57
|
-
* reload: true, // force a reload if the owner model is already cached
|
58
|
-
* callback: function(address, operation) {}, // a function that will always be called
|
59
|
-
* success : function(address, operation) {}, // a function that will only be called if the load succeeded
|
60
|
-
* failure : function(address, operation) {}, // a function that will only be called if the load did not succeed
|
61
|
-
* scope : this // optionally pass in a scope object to execute the callbacks in
|
62
|
-
* });
|
63
|
-
*
|
64
|
-
* In each case above the callbacks are called with two arguments - the associated model instance and the
|
65
|
-
* {@link Ext.data.Operation operation} object that was executed to load that instance. The Operation object is
|
66
|
-
* useful when the instance could not be loaded.
|
67
|
-
*
|
68
|
-
* Once the getter has been called on the model, it will be cached if the getter is called a second time. To
|
69
|
-
* force the model to reload, specify reload: true in the options object.
|
70
|
-
*
|
71
|
-
* ## Generated setter function
|
72
|
-
*
|
73
|
-
* The second generated function sets the associated model instance - if only a single argument is passed to
|
74
|
-
* the setter then the following two calls are identical:
|
75
|
-
*
|
76
|
-
* // this call...
|
77
|
-
* person.setAddress(10);
|
78
|
-
*
|
79
|
-
* // is equivalent to this call:
|
80
|
-
* person.set('address_id', 10);
|
81
|
-
*
|
82
|
-
* An instance of the owner model can also be passed as a parameter.
|
83
|
-
*
|
84
|
-
* If we pass in a second argument, the model will be automatically saved and the second argument passed to
|
85
|
-
* the owner model's {@link Ext.data.Model#save save} method:
|
86
|
-
*
|
87
|
-
* person.setAddress(10, function(address, operation) {
|
88
|
-
* // the address has been saved
|
89
|
-
* alert(address.get('address_id')); //now alerts 10
|
90
|
-
* });
|
91
|
-
*
|
92
|
-
* //alternative syntax:
|
93
|
-
* person.setAddress(10, {
|
94
|
-
* callback: function(address, operation), // a function that will always be called
|
95
|
-
* success : function(address, operation), // a function that will only be called if the load succeeded
|
96
|
-
* failure : function(address, operation), // a function that will only be called if the load did not succeed
|
97
|
-
* scope : this //optionally pass in a scope object to execute the callbacks in
|
98
|
-
* })
|
99
|
-
*
|
100
|
-
* ## Customisation
|
101
|
-
*
|
102
|
-
* Associations reflect on the models they are linking to automatically set up properties such as the
|
103
|
-
* {@link #primaryKey} and {@link #foreignKey}. These can alternatively be specified:
|
104
|
-
*
|
105
|
-
* Ext.define('Person', {
|
106
|
-
* fields: [...],
|
107
|
-
*
|
108
|
-
* associations: [
|
109
|
-
* { type: 'hasOne', model: 'Address', primaryKey: 'unique_id', foreignKey: 'addr_id' }
|
110
|
-
* ]
|
111
|
-
* });
|
112
|
-
*
|
113
|
-
* Here we replaced the default primary key (defaults to 'id') and foreign key (calculated as 'address_id')
|
114
|
-
* with our own settings. Usually this will not be needed.
|
115
|
-
*/
|
116
|
-
Ext.define('Ext.data.association.HasOne', {
|
117
|
-
extend: 'Ext.data.association.Association',
|
118
|
-
alternateClassName: 'Ext.data.HasOneAssociation',
|
119
|
-
|
120
|
-
alias: 'association.hasone',
|
121
|
-
|
122
|
-
/**
|
123
|
-
* @cfg {String} foreignKey The name of the foreign key on the owner model that links it to the associated
|
124
|
-
* model. Defaults to the lowercased name of the associated model plus "_id", e.g. an association with a
|
125
|
-
* model called Person would set up a address_id foreign key.
|
126
|
-
*
|
127
|
-
* Ext.define('Person', {
|
128
|
-
* extend: 'Ext.data.Model',
|
129
|
-
* fields: ['id', 'name', 'address_id'], // refers to the id of the address object
|
130
|
-
* hasOne: 'Address'
|
131
|
-
* });
|
132
|
-
*
|
133
|
-
* Ext.define('Address', {
|
134
|
-
* extend: 'Ext.data.Model',
|
135
|
-
* fields: ['id', 'number', 'street', 'city', 'zip'],
|
136
|
-
* belongsTo: 'Person'
|
137
|
-
* });
|
138
|
-
* var Person = new Person({
|
139
|
-
* id: 1,
|
140
|
-
* name: 'John Smith',
|
141
|
-
* address_id: 13
|
142
|
-
* }, 1);
|
143
|
-
* person.getAddress(); // Will make a call to the server asking for address_id 13
|
144
|
-
*
|
145
|
-
*/
|
146
|
-
|
147
|
-
/**
|
148
|
-
* @cfg {String} getterName The name of the getter function that will be added to the local model's prototype.
|
149
|
-
* Defaults to 'get' + the name of the foreign model, e.g. getAddress
|
150
|
-
*/
|
151
|
-
|
152
|
-
/**
|
153
|
-
* @cfg {String} setterName The name of the setter function that will be added to the local model's prototype.
|
154
|
-
* Defaults to 'set' + the name of the foreign model, e.g. setAddress
|
155
|
-
*/
|
156
|
-
|
157
|
-
/**
|
158
|
-
* @cfg {String} type The type configuration can be used when creating associations using a configuration object.
|
159
|
-
* Use 'hasOne' to create a HasOne association.
|
160
|
-
*
|
161
|
-
* associations: [{
|
162
|
-
* type: 'hasOne',
|
163
|
-
* model: 'Address'
|
164
|
-
* }]
|
165
|
-
*/
|
166
|
-
|
167
|
-
constructor: function(config) {
|
168
|
-
this.callParent(arguments);
|
169
|
-
|
170
|
-
var me = this,
|
171
|
-
ownerProto = me.ownerModel.prototype,
|
172
|
-
associatedName = me.associatedName,
|
173
|
-
getterName = me.getterName || 'get' + associatedName,
|
174
|
-
setterName = me.setterName || 'set' + associatedName;
|
175
|
-
|
176
|
-
Ext.applyIf(me, {
|
177
|
-
name : associatedName,
|
178
|
-
foreignKey : associatedName.toLowerCase() + "_id",
|
179
|
-
instanceName: associatedName + 'HasOneInstance',
|
180
|
-
associationKey: associatedName.toLowerCase()
|
181
|
-
});
|
182
|
-
|
183
|
-
ownerProto[getterName] = me.createGetter();
|
184
|
-
ownerProto[setterName] = me.createSetter();
|
185
|
-
},
|
186
|
-
|
187
|
-
/**
|
188
|
-
* @private
|
189
|
-
* Returns a setter function to be placed on the owner model's prototype
|
190
|
-
* @return {Function} The setter function
|
191
|
-
*/
|
192
|
-
createSetter: function() {
|
193
|
-
var me = this,
|
194
|
-
ownerModel = me.ownerModel,
|
195
|
-
foreignKey = me.foreignKey;
|
196
|
-
|
197
|
-
//'this' refers to the Model instance inside this function
|
198
|
-
return function(value, options, scope) {
|
199
|
-
if (value && value.isModel) {
|
200
|
-
value = value.getId();
|
201
|
-
}
|
202
|
-
|
203
|
-
this.set(foreignKey, value);
|
204
|
-
|
205
|
-
if (Ext.isFunction(options)) {
|
206
|
-
options = {
|
207
|
-
callback: options,
|
208
|
-
scope: scope || this
|
209
|
-
};
|
210
|
-
}
|
211
|
-
|
212
|
-
if (Ext.isObject(options)) {
|
213
|
-
return this.save(options);
|
214
|
-
}
|
215
|
-
};
|
216
|
-
},
|
217
|
-
|
218
|
-
/**
|
219
|
-
* @private
|
220
|
-
* Returns a getter function to be placed on the owner model's prototype. We cache the loaded instance
|
221
|
-
* the first time it is loaded so that subsequent calls to the getter always receive the same reference.
|
222
|
-
* @return {Function} The getter function
|
223
|
-
*/
|
224
|
-
createGetter: function() {
|
225
|
-
var me = this,
|
226
|
-
ownerModel = me.ownerModel,
|
227
|
-
associatedName = me.associatedName,
|
228
|
-
associatedModel = me.associatedModel,
|
229
|
-
foreignKey = me.foreignKey,
|
230
|
-
primaryKey = me.primaryKey,
|
231
|
-
instanceName = me.instanceName;
|
232
|
-
|
233
|
-
//'this' refers to the Model instance inside this function
|
234
|
-
return function(options, scope) {
|
235
|
-
options = options || {};
|
236
|
-
|
237
|
-
var model = this,
|
238
|
-
foreignKeyId = model.get(foreignKey),
|
239
|
-
success,
|
240
|
-
instance,
|
241
|
-
args;
|
242
|
-
|
243
|
-
if (options.reload === true || model[instanceName] === undefined) {
|
244
|
-
instance = Ext.ModelManager.create({}, associatedName);
|
245
|
-
instance.set(primaryKey, foreignKeyId);
|
246
|
-
|
247
|
-
if (typeof options == 'function') {
|
248
|
-
options = {
|
249
|
-
callback: options,
|
250
|
-
scope: scope || model
|
251
|
-
};
|
252
|
-
}
|
253
|
-
|
254
|
-
// Overwrite the success handler so we can assign the current instance
|
255
|
-
success = options.success;
|
256
|
-
options.success = function(rec){
|
257
|
-
model[instanceName] = rec;
|
258
|
-
if (success) {
|
259
|
-
success.call(this, arguments);
|
260
|
-
}
|
261
|
-
};
|
262
|
-
|
263
|
-
associatedModel.load(foreignKeyId, options);
|
264
|
-
// assign temporarily while we wait for data to return
|
265
|
-
model[instanceName] = instance;
|
266
|
-
return instance;
|
267
|
-
} else {
|
268
|
-
instance = model[instanceName];
|
269
|
-
args = [instance];
|
270
|
-
scope = scope || model;
|
271
|
-
|
272
|
-
//TODO: We're duplicating the callback invokation code that the instance.load() call above
|
273
|
-
//makes here - ought to be able to normalize this - perhaps by caching at the Model.load layer
|
274
|
-
//instead of the association layer.
|
275
|
-
Ext.callback(options, scope, args);
|
276
|
-
Ext.callback(options.success, scope, args);
|
277
|
-
Ext.callback(options.failure, scope, args);
|
278
|
-
Ext.callback(options.callback, scope, args);
|
279
|
-
|
280
|
-
return instance;
|
281
|
-
}
|
282
|
-
};
|
283
|
-
},
|
284
|
-
|
285
|
-
/**
|
286
|
-
* Read associated data
|
287
|
-
* @private
|
288
|
-
* @param {Ext.data.Model} record The record we're writing to
|
289
|
-
* @param {Ext.data.reader.Reader} reader The reader for the associated model
|
290
|
-
* @param {Object} associationData The raw associated data
|
291
|
-
*/
|
292
|
-
read: function(record, reader, associationData){
|
293
|
-
var inverse = this.associatedModel.prototype.associations.findBy(function(assoc){
|
294
|
-
return assoc.type === 'belongsTo' && assoc.associatedName === record.$className;
|
295
|
-
}), newRecord = reader.read([associationData]).records[0];
|
296
|
-
|
297
|
-
record[this.instanceName] = newRecord;
|
298
|
-
|
299
|
-
//if the inverse association was found, set it now on each record we've just created
|
300
|
-
if (inverse) {
|
301
|
-
newRecord[inverse.instanceName] = record;
|
302
|
-
}
|
303
|
-
}
|
304
|
-
});
|