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,735 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* @author Ed Spencer
|
3
|
-
*
|
4
|
-
* Readers are used to interpret data to be loaded into a {@link Ext.data.Model Model} instance or a {@link
|
5
|
-
* Ext.data.Store Store} - often in response to an AJAX request. In general there is usually no need to create
|
6
|
-
* a Reader instance directly, since a Reader is almost always used together with a {@link Ext.data.proxy.Proxy Proxy},
|
7
|
-
* and is configured using the Proxy's {@link Ext.data.proxy.Proxy#cfg-reader reader} configuration property:
|
8
|
-
*
|
9
|
-
* Ext.create('Ext.data.Store', {
|
10
|
-
* model: 'User',
|
11
|
-
* proxy: {
|
12
|
-
* type: 'ajax',
|
13
|
-
* url : 'users.json',
|
14
|
-
* reader: {
|
15
|
-
* type: 'json',
|
16
|
-
* root: 'users'
|
17
|
-
* }
|
18
|
-
* },
|
19
|
-
* });
|
20
|
-
*
|
21
|
-
* The above reader is configured to consume a JSON string that looks something like this:
|
22
|
-
*
|
23
|
-
* {
|
24
|
-
* "success": true,
|
25
|
-
* "users": [
|
26
|
-
* { "name": "User 1" },
|
27
|
-
* { "name": "User 2" }
|
28
|
-
* ]
|
29
|
-
* }
|
30
|
-
*
|
31
|
-
*
|
32
|
-
* # Loading Nested Data
|
33
|
-
*
|
34
|
-
* Readers have the ability to automatically load deeply-nested data objects based on the {@link Ext.data.association.Association
|
35
|
-
* associations} configured on each Model. Below is an example demonstrating the flexibility of these associations in a
|
36
|
-
* fictional CRM system which manages a User, their Orders, OrderItems and Products. First we'll define the models:
|
37
|
-
*
|
38
|
-
* Ext.define("User", {
|
39
|
-
* extend: 'Ext.data.Model',
|
40
|
-
* fields: [
|
41
|
-
* 'id', 'name'
|
42
|
-
* ],
|
43
|
-
*
|
44
|
-
* hasMany: {model: 'Order', name: 'orders'},
|
45
|
-
*
|
46
|
-
* proxy: {
|
47
|
-
* type: 'rest',
|
48
|
-
* url : 'users.json',
|
49
|
-
* reader: {
|
50
|
-
* type: 'json',
|
51
|
-
* root: 'users'
|
52
|
-
* }
|
53
|
-
* }
|
54
|
-
* });
|
55
|
-
*
|
56
|
-
* Ext.define("Order", {
|
57
|
-
* extend: 'Ext.data.Model',
|
58
|
-
* fields: [
|
59
|
-
* 'id', 'total'
|
60
|
-
* ],
|
61
|
-
*
|
62
|
-
* hasMany : {model: 'OrderItem', name: 'orderItems', associationKey: 'order_items'},
|
63
|
-
* belongsTo: 'User'
|
64
|
-
* });
|
65
|
-
*
|
66
|
-
* Ext.define("OrderItem", {
|
67
|
-
* extend: 'Ext.data.Model',
|
68
|
-
* fields: [
|
69
|
-
* 'id', 'price', 'quantity', 'order_id', 'product_id'
|
70
|
-
* ],
|
71
|
-
*
|
72
|
-
* belongsTo: ['Order', {model: 'Product', associationKey: 'product'}]
|
73
|
-
* });
|
74
|
-
*
|
75
|
-
* Ext.define("Product", {
|
76
|
-
* extend: 'Ext.data.Model',
|
77
|
-
* fields: [
|
78
|
-
* 'id', 'name'
|
79
|
-
* ],
|
80
|
-
*
|
81
|
-
* hasMany: 'OrderItem'
|
82
|
-
* });
|
83
|
-
*
|
84
|
-
* This may be a lot to take in - basically a User has many Orders, each of which is composed of several OrderItems.
|
85
|
-
* Finally, each OrderItem has a single Product. This allows us to consume data like this:
|
86
|
-
*
|
87
|
-
* {
|
88
|
-
* "users": [
|
89
|
-
* {
|
90
|
-
* "id": 123,
|
91
|
-
* "name": "Ed",
|
92
|
-
* "orders": [
|
93
|
-
* {
|
94
|
-
* "id": 50,
|
95
|
-
* "total": 100,
|
96
|
-
* "order_items": [
|
97
|
-
* {
|
98
|
-
* "id" : 20,
|
99
|
-
* "price" : 40,
|
100
|
-
* "quantity": 2,
|
101
|
-
* "product" : {
|
102
|
-
* "id": 1000,
|
103
|
-
* "name": "MacBook Pro"
|
104
|
-
* }
|
105
|
-
* },
|
106
|
-
* {
|
107
|
-
* "id" : 21,
|
108
|
-
* "price" : 20,
|
109
|
-
* "quantity": 3,
|
110
|
-
* "product" : {
|
111
|
-
* "id": 1001,
|
112
|
-
* "name": "iPhone"
|
113
|
-
* }
|
114
|
-
* }
|
115
|
-
* ]
|
116
|
-
* }
|
117
|
-
* ]
|
118
|
-
* }
|
119
|
-
* ]
|
120
|
-
* }
|
121
|
-
*
|
122
|
-
* The JSON response is deeply nested - it returns all Users (in this case just 1 for simplicity's sake), all of the
|
123
|
-
* Orders for each User (again just 1 in this case), all of the OrderItems for each Order (2 order items in this case),
|
124
|
-
* and finally the Product associated with each OrderItem. Now we can read the data and use it as follows:
|
125
|
-
*
|
126
|
-
* var store = Ext.create('Ext.data.Store', {
|
127
|
-
* model: "User"
|
128
|
-
* });
|
129
|
-
*
|
130
|
-
* store.load({
|
131
|
-
* callback: function() {
|
132
|
-
* //the user that was loaded
|
133
|
-
* var user = store.first();
|
134
|
-
*
|
135
|
-
* console.log("Orders for " + user.get('name') + ":")
|
136
|
-
*
|
137
|
-
* //iterate over the Orders for each User
|
138
|
-
* user.orders().each(function(order) {
|
139
|
-
* console.log("Order ID: " + order.getId() + ", which contains items:");
|
140
|
-
*
|
141
|
-
* //iterate over the OrderItems for each Order
|
142
|
-
* order.orderItems().each(function(orderItem) {
|
143
|
-
* //we know that the Product data is already loaded, so we can use the synchronous getProduct
|
144
|
-
* //usually, we would use the asynchronous version (see {@link Ext.data.association.BelongsTo})
|
145
|
-
* var product = orderItem.getProduct();
|
146
|
-
*
|
147
|
-
* console.log(orderItem.get('quantity') + ' orders of ' + product.get('name'));
|
148
|
-
* });
|
149
|
-
* });
|
150
|
-
* }
|
151
|
-
* });
|
152
|
-
*
|
153
|
-
* Running the code above results in the following:
|
154
|
-
*
|
155
|
-
* Orders for Ed:
|
156
|
-
* Order ID: 50, which contains items:
|
157
|
-
* 2 orders of MacBook Pro
|
158
|
-
* 3 orders of iPhone
|
159
|
-
*/
|
160
|
-
Ext.define('Ext.data.reader.Reader', {
|
161
|
-
requires: ['Ext.data.ResultSet'],
|
162
|
-
alternateClassName: ['Ext.data.Reader', 'Ext.data.DataReader'],
|
163
|
-
|
164
|
-
mixins: {
|
165
|
-
observable: 'Ext.util.Observable'
|
166
|
-
},
|
167
|
-
|
168
|
-
/**
|
169
|
-
* @cfg {String} idProperty
|
170
|
-
* Name of the property within a row object that contains a record identifier value. Defaults to the id of the
|
171
|
-
* model. If an idProperty is explicitly specified it will override the idProperty defined on the model.
|
172
|
-
*/
|
173
|
-
|
174
|
-
/**
|
175
|
-
* @cfg {String} [totalProperty="total"]
|
176
|
-
* Name of the property from which to retrieve the total number of records in the dataset. This is only needed if
|
177
|
-
* the whole dataset is not passed in one go, but is being paged from the remote server.
|
178
|
-
*/
|
179
|
-
totalProperty: 'total',
|
180
|
-
|
181
|
-
/**
|
182
|
-
* @cfg {String} [successProperty="success"]
|
183
|
-
* Name of the property from which to retrieve the `success` attribute, the value of which indicates
|
184
|
-
* whether a given request succeeded or failed (typically a boolean or 'true'|'false'). See
|
185
|
-
* {@link Ext.data.proxy.Server}.{@link Ext.data.proxy.Server#exception exception} for additional information.
|
186
|
-
*/
|
187
|
-
successProperty: 'success',
|
188
|
-
|
189
|
-
/**
|
190
|
-
* @cfg {String} root
|
191
|
-
* The name of the property which contains the data items corresponding to the Model(s) for which this
|
192
|
-
* Reader is configured. For JSON reader it's a property name (or a dot-separated list of property names
|
193
|
-
* if the root is nested). For XML reader it's a CSS selector. For Array reader the root is not applicable
|
194
|
-
* since the data is assumed to be a single-level array of arrays.
|
195
|
-
*
|
196
|
-
* By default the natural root of the data will be used: the root JSON array, the root XML element, or the array.
|
197
|
-
*
|
198
|
-
* The data packet value for this property should be an empty array to clear the data or show no data.
|
199
|
-
*/
|
200
|
-
root: '',
|
201
|
-
|
202
|
-
/**
|
203
|
-
* @cfg {String} messageProperty
|
204
|
-
* The name of the property which contains a response message. This property is optional.
|
205
|
-
*/
|
206
|
-
|
207
|
-
/**
|
208
|
-
* @cfg {Boolean} [implicitIncludes=true]
|
209
|
-
* True to automatically parse models nested within other models in a response object. See the
|
210
|
-
* Ext.data.reader.Reader intro docs for full explanation.
|
211
|
-
*/
|
212
|
-
implicitIncludes: true,
|
213
|
-
|
214
|
-
/**
|
215
|
-
* @cfg {Boolean} [readRecordsOnFailure=true]
|
216
|
-
* True to extract the records from a data packet even if the {@link #success} property returns false.
|
217
|
-
*/
|
218
|
-
readRecordsOnFailure: true,
|
219
|
-
|
220
|
-
/**
|
221
|
-
* @property {Object} metaData
|
222
|
-
* The raw meta data that was most recently read, if any. Meta data can include existing
|
223
|
-
* Reader config options like {@link #idProperty}, {@link #totalProperty}, etc. that get
|
224
|
-
* automatically applied to the Reader, and those can still be accessed directly from the Reader
|
225
|
-
* if needed. However, meta data is also often used to pass other custom data to be processed
|
226
|
-
* by application code. For example, it is common when reconfiguring the data model of a grid to
|
227
|
-
* also pass a corresponding column model config to be applied to the grid. Any such data will
|
228
|
-
* not get applied to the Reader directly (it just gets passed through and is ignored by Ext).
|
229
|
-
* This metaData property gives you access to all meta data that was passed, including any such
|
230
|
-
* custom data ignored by the reader.
|
231
|
-
*
|
232
|
-
* This is a read-only property, and it will get replaced each time a new meta data object is
|
233
|
-
* passed to the reader. Note that typically you would handle proxy's
|
234
|
-
* {@link Ext.data.proxy.Proxy#metachange metachange} event which passes this exact same meta
|
235
|
-
* object to listeners. However this property is available if it's more convenient to access it
|
236
|
-
* via the reader directly in certain cases.
|
237
|
-
* @readonly
|
238
|
-
*/
|
239
|
-
|
240
|
-
/*
|
241
|
-
* @property {Boolean} isReader
|
242
|
-
* `true` in this class to identify an object as an instantiated Reader, or subclass thereof.
|
243
|
-
*/
|
244
|
-
isReader: true,
|
245
|
-
|
246
|
-
// Private flag to the generated convertRecordData function to indicate whether to apply Field default
|
247
|
-
// values to fields for which no value is present in the raw data.
|
248
|
-
// This is set to false by a Server Proxy which is reading the response from a "create" or "update" operation.
|
249
|
-
applyDefaults: true,
|
250
|
-
|
251
|
-
/**
|
252
|
-
* Creates new Reader.
|
253
|
-
* @param {Object} config (optional) Config object.
|
254
|
-
*/
|
255
|
-
constructor: function(config) {
|
256
|
-
var me = this;
|
257
|
-
|
258
|
-
me.mixins.observable.constructor.call(me, config);
|
259
|
-
me.fieldCount = 0;
|
260
|
-
me.model = Ext.ModelManager.getModel(me.model);
|
261
|
-
|
262
|
-
// Extractors can only be calculated if the fields MixedCollection has been set.
|
263
|
-
// A Model may only complete its setup (set the prototype properties) after asynchronous loading
|
264
|
-
// which would mean that there may be no "fields"
|
265
|
-
// If this happens, the load callback will call proxy.setModel which calls reader.setModel which
|
266
|
-
// triggers buildExtractors.
|
267
|
-
if (me.model && me.model.prototype.fields) {
|
268
|
-
me.buildExtractors();
|
269
|
-
}
|
270
|
-
|
271
|
-
this.addEvents(
|
272
|
-
/**
|
273
|
-
* @event
|
274
|
-
* Fires when the reader receives improperly encoded data from the server
|
275
|
-
* @param {Ext.data.reader.Reader} reader A reference to this reader
|
276
|
-
* @param {XMLHttpRequest} response The XMLHttpRequest response object
|
277
|
-
* @param {Ext.data.ResultSet} error The error object
|
278
|
-
*/
|
279
|
-
'exception'
|
280
|
-
);
|
281
|
-
},
|
282
|
-
|
283
|
-
/**
|
284
|
-
* Sets a new model for the reader.
|
285
|
-
* @private
|
286
|
-
* @param {Object} model The model to set.
|
287
|
-
* @param {Boolean} setOnProxy True to also set on the Proxy, if one is configured
|
288
|
-
*/
|
289
|
-
setModel: function(model, setOnProxy) {
|
290
|
-
var me = this;
|
291
|
-
|
292
|
-
me.model = Ext.ModelManager.getModel(model);
|
293
|
-
me.buildExtractors(true);
|
294
|
-
|
295
|
-
if (setOnProxy && me.proxy) {
|
296
|
-
me.proxy.setModel(me.model, true);
|
297
|
-
}
|
298
|
-
},
|
299
|
-
|
300
|
-
/**
|
301
|
-
* Reads the given response object. This method normalizes the different types of response object that may be passed to it.
|
302
|
-
* If it's an XMLHttpRequest object, hand off to the subclass' {@link #getResponseData} method.
|
303
|
-
* Else, hand off the reading of records to the {@link #readRecords} method.
|
304
|
-
* @param {Object} response The response object. This may be either an XMLHttpRequest object or a plain JS object
|
305
|
-
* @return {Ext.data.ResultSet} The parsed or default ResultSet object
|
306
|
-
*/
|
307
|
-
read: function(response) {
|
308
|
-
var data;
|
309
|
-
|
310
|
-
if (response) {
|
311
|
-
data = response.responseText ? this.getResponseData(response) : this.readRecords(response);
|
312
|
-
}
|
313
|
-
|
314
|
-
return data || this.nullResultSet;
|
315
|
-
},
|
316
|
-
|
317
|
-
/**
|
318
|
-
* Abstracts common functionality used by all Reader subclasses. Each subclass is expected to call this function
|
319
|
-
* before running its own logic and returning the Ext.data.ResultSet instance. For most Readers additional
|
320
|
-
* processing should not be needed.
|
321
|
-
* @param {Object} data The raw data object
|
322
|
-
* @return {Ext.data.ResultSet} A ResultSet object
|
323
|
-
*/
|
324
|
-
readRecords: function(data) {
|
325
|
-
var me = this,
|
326
|
-
success,
|
327
|
-
recordCount,
|
328
|
-
records,
|
329
|
-
root,
|
330
|
-
total,
|
331
|
-
value,
|
332
|
-
message;
|
333
|
-
|
334
|
-
/*
|
335
|
-
* We check here whether the number of fields has changed since the last read.
|
336
|
-
* This works around an issue when a Model is used for both a Tree and another
|
337
|
-
* source, because the tree decorates the model with extra fields and it causes
|
338
|
-
* issues because the readers aren't notified.
|
339
|
-
*/
|
340
|
-
if (me.fieldCount !== me.getFields().length) {
|
341
|
-
me.buildExtractors(true);
|
342
|
-
}
|
343
|
-
|
344
|
-
/**
|
345
|
-
* @property {Object} rawData
|
346
|
-
* The raw data object that was last passed to {@link #readRecords}. Stored for further processing if needed.
|
347
|
-
*/
|
348
|
-
me.rawData = data;
|
349
|
-
|
350
|
-
data = me.getData(data);
|
351
|
-
|
352
|
-
success = true;
|
353
|
-
recordCount = 0;
|
354
|
-
records = [];
|
355
|
-
|
356
|
-
if (me.successProperty) {
|
357
|
-
value = me.getSuccess(data);
|
358
|
-
if (value === false || value === 'false') {
|
359
|
-
success = false;
|
360
|
-
}
|
361
|
-
}
|
362
|
-
|
363
|
-
if (me.messageProperty) {
|
364
|
-
message = me.getMessage(data);
|
365
|
-
}
|
366
|
-
|
367
|
-
|
368
|
-
// Only try and extract other data if call was successful
|
369
|
-
if (me.readRecordsOnFailure || success) {
|
370
|
-
// If we pass an array as the data, we dont use getRoot on the data.
|
371
|
-
// Instead the root equals to the data.
|
372
|
-
root = Ext.isArray(data) ? data : me.getRoot(data);
|
373
|
-
|
374
|
-
if (root) {
|
375
|
-
total = root.length;
|
376
|
-
}
|
377
|
-
|
378
|
-
if (me.totalProperty) {
|
379
|
-
value = parseInt(me.getTotal(data), 10);
|
380
|
-
if (!isNaN(value)) {
|
381
|
-
total = value;
|
382
|
-
}
|
383
|
-
}
|
384
|
-
|
385
|
-
if (root) {
|
386
|
-
records = me.extractData(root);
|
387
|
-
recordCount = records.length;
|
388
|
-
}
|
389
|
-
}
|
390
|
-
|
391
|
-
return new Ext.data.ResultSet({
|
392
|
-
total : total || recordCount,
|
393
|
-
count : recordCount,
|
394
|
-
records: records,
|
395
|
-
success: success,
|
396
|
-
message: message
|
397
|
-
});
|
398
|
-
},
|
399
|
-
|
400
|
-
/**
|
401
|
-
* Returns extracted, type-cast rows of data.
|
402
|
-
* @param {Object[]/Object} root from server response
|
403
|
-
* @return {Array} An array of records containing the extracted data
|
404
|
-
* @private
|
405
|
-
*/
|
406
|
-
extractData : function(root) {
|
407
|
-
var me = this,
|
408
|
-
records = [],
|
409
|
-
Model = me.model,
|
410
|
-
length = root.length,
|
411
|
-
convertedValues, node, record, i;
|
412
|
-
|
413
|
-
if (!root.length && Ext.isObject(root)) {
|
414
|
-
root = [root];
|
415
|
-
length = 1;
|
416
|
-
}
|
417
|
-
|
418
|
-
for (i = 0; i < length; i++) {
|
419
|
-
node = root[i];
|
420
|
-
// Create a record with an empty data object.
|
421
|
-
// Populate that data object by extracting and converting field values from raw data
|
422
|
-
record = new Model(undefined, me.getId(node), node, convertedValues = {});
|
423
|
-
|
424
|
-
// If the server did not include an id in the response data, the Model constructor will mark the record as phantom.
|
425
|
-
// We need to set phantom to false here because records created from a server response using a reader by definition are not phantom records.
|
426
|
-
record.phantom = false;
|
427
|
-
|
428
|
-
// Use generated function to extract all fields at once
|
429
|
-
me.convertRecordData(convertedValues, node, record);
|
430
|
-
|
431
|
-
records.push(record);
|
432
|
-
|
433
|
-
if (me.implicitIncludes) {
|
434
|
-
me.readAssociated(record, node);
|
435
|
-
}
|
436
|
-
}
|
437
|
-
|
438
|
-
return records;
|
439
|
-
},
|
440
|
-
|
441
|
-
/**
|
442
|
-
* @private
|
443
|
-
* Loads a record's associations from the data object. This prepopulates hasMany and belongsTo associations
|
444
|
-
* on the record provided.
|
445
|
-
* @param {Ext.data.Model} record The record to load associations for
|
446
|
-
* @param {Object} data The data object
|
447
|
-
* @return {String} Return value description
|
448
|
-
*/
|
449
|
-
readAssociated: function(record, data) {
|
450
|
-
var associations = record.associations.items,
|
451
|
-
i = 0,
|
452
|
-
length = associations.length,
|
453
|
-
association, associationData, proxy, reader;
|
454
|
-
|
455
|
-
for (; i < length; i++) {
|
456
|
-
association = associations[i];
|
457
|
-
associationData = this.getAssociatedDataRoot(data, association.associationKey || association.name);
|
458
|
-
|
459
|
-
if (associationData) {
|
460
|
-
reader = association.getReader();
|
461
|
-
if (!reader) {
|
462
|
-
proxy = association.associatedModel.proxy;
|
463
|
-
// if the associated model has a Reader already, use that, otherwise attempt to create a sensible one
|
464
|
-
if (proxy) {
|
465
|
-
reader = proxy.getReader();
|
466
|
-
} else {
|
467
|
-
reader = new this.constructor({
|
468
|
-
model: association.associatedName
|
469
|
-
});
|
470
|
-
}
|
471
|
-
}
|
472
|
-
association.read(record, reader, associationData);
|
473
|
-
}
|
474
|
-
}
|
475
|
-
},
|
476
|
-
|
477
|
-
/**
|
478
|
-
* @private
|
479
|
-
* Used internally by {@link #readAssociated}. Given a data object (which could be json, xml etc) for a specific
|
480
|
-
* record, this should return the relevant part of that data for the given association name. This is only really
|
481
|
-
* needed to support the XML Reader, which has to do a query to get the associated data object
|
482
|
-
* @param {Object} data The raw data object
|
483
|
-
* @param {String} associationName The name of the association to get data for (uses associationKey if present)
|
484
|
-
* @return {Object} The root
|
485
|
-
*/
|
486
|
-
getAssociatedDataRoot: function(data, associationName) {
|
487
|
-
return data[associationName];
|
488
|
-
},
|
489
|
-
|
490
|
-
getFields: function() {
|
491
|
-
return this.model.prototype.fields.items;
|
492
|
-
},
|
493
|
-
|
494
|
-
/**
|
495
|
-
* @private
|
496
|
-
* By default this function just returns what is passed to it. It can be overridden in a subclass
|
497
|
-
* to return something else. See XmlReader for an example.
|
498
|
-
* @param {Object} data The data object
|
499
|
-
* @return {Object} The normalized data object
|
500
|
-
*/
|
501
|
-
getData: function(data) {
|
502
|
-
return data;
|
503
|
-
},
|
504
|
-
|
505
|
-
/**
|
506
|
-
* @private
|
507
|
-
* This will usually need to be implemented in a subclass. Given a generic data object (the type depends on the type
|
508
|
-
* of data we are reading), this function should return the object as configured by the Reader's 'root' meta data config.
|
509
|
-
* See XmlReader's getRoot implementation for an example. By default the same data object will simply be returned.
|
510
|
-
* @param {Object} data The data object
|
511
|
-
* @return {Object} The same data object
|
512
|
-
*/
|
513
|
-
getRoot: function(data) {
|
514
|
-
return data;
|
515
|
-
},
|
516
|
-
|
517
|
-
/**
|
518
|
-
* Takes a raw response object (as passed to the {@link #read} method) and returns the useful data
|
519
|
-
* segment from it. This must be implemented by each subclass.
|
520
|
-
* @param {Object} response The response object
|
521
|
-
* @return {Ext.data.ResultSet} A ResultSet object
|
522
|
-
*/
|
523
|
-
getResponseData: function(response) {
|
524
|
-
//<debug>
|
525
|
-
Ext.Error.raise("getResponseData must be implemented in the Ext.data.reader.Reader subclass");
|
526
|
-
//</debug>
|
527
|
-
},
|
528
|
-
|
529
|
-
/**
|
530
|
-
* @private
|
531
|
-
* Reconfigures the meta data tied to this Reader
|
532
|
-
*/
|
533
|
-
onMetaChange : function(meta) {
|
534
|
-
var me = this,
|
535
|
-
fields = meta.fields || me.getFields(),
|
536
|
-
newModel,
|
537
|
-
clientIdProperty;
|
538
|
-
|
539
|
-
// save off the raw meta data
|
540
|
-
me.metaData = meta;
|
541
|
-
|
542
|
-
// set any reader-specific configs from meta if available
|
543
|
-
me.root = meta.root || me.root;
|
544
|
-
me.idProperty = meta.idProperty || me.idProperty;
|
545
|
-
me.totalProperty = meta.totalProperty || me.totalProperty;
|
546
|
-
me.successProperty = meta.successProperty || me.successProperty;
|
547
|
-
me.messageProperty = meta.messageProperty || me.messageProperty;
|
548
|
-
clientIdProperty = meta.clientIdProperty;
|
549
|
-
|
550
|
-
if (me.model) {
|
551
|
-
me.model.setFields(fields, me.idProperty, clientIdProperty);
|
552
|
-
me.setModel(me.model, true);
|
553
|
-
}
|
554
|
-
else {
|
555
|
-
newModel = Ext.define("Ext.data.reader.Json-Model" + Ext.id(), {
|
556
|
-
extend: 'Ext.data.Model',
|
557
|
-
fields: fields,
|
558
|
-
clientIdProperty: clientIdProperty
|
559
|
-
});
|
560
|
-
if (me.idProperty) {
|
561
|
-
// We only do this if the reader actually has a custom idProperty set,
|
562
|
-
// otherwise let the model use its own default value. It is valid for
|
563
|
-
// the reader idProperty to be undefined, in which case it will use the
|
564
|
-
// model's idProperty (in getIdProperty()).
|
565
|
-
newModel.idProperty = me.idProperty;
|
566
|
-
}
|
567
|
-
me.setModel(newModel, true);
|
568
|
-
}
|
569
|
-
},
|
570
|
-
|
571
|
-
/**
|
572
|
-
* Get the idProperty to use for extracting data
|
573
|
-
* @private
|
574
|
-
* @return {String} The id property
|
575
|
-
*/
|
576
|
-
getIdProperty: function(){
|
577
|
-
return this.idProperty || this.model.prototype.idProperty;
|
578
|
-
},
|
579
|
-
|
580
|
-
/**
|
581
|
-
* @private
|
582
|
-
* This builds optimized functions for retrieving record data and meta data from an object.
|
583
|
-
* Subclasses may need to implement their own getRoot function.
|
584
|
-
* @param {Boolean} [force=false] True to automatically remove existing extractor functions first
|
585
|
-
*/
|
586
|
-
buildExtractors: function(force) {
|
587
|
-
var me = this,
|
588
|
-
idProp = me.getIdProperty(),
|
589
|
-
totalProp = me.totalProperty,
|
590
|
-
successProp = me.successProperty,
|
591
|
-
messageProp = me.messageProperty,
|
592
|
-
accessor,
|
593
|
-
idField,
|
594
|
-
map;
|
595
|
-
|
596
|
-
if (force === true) {
|
597
|
-
delete me.convertRecordData;
|
598
|
-
}
|
599
|
-
|
600
|
-
if (me.convertRecordData) {
|
601
|
-
return;
|
602
|
-
}
|
603
|
-
|
604
|
-
//build the extractors for all the meta data
|
605
|
-
if (totalProp) {
|
606
|
-
me.getTotal = me.createAccessor(totalProp);
|
607
|
-
}
|
608
|
-
|
609
|
-
if (successProp) {
|
610
|
-
me.getSuccess = me.createAccessor(successProp);
|
611
|
-
}
|
612
|
-
|
613
|
-
if (messageProp) {
|
614
|
-
me.getMessage = me.createAccessor(messageProp);
|
615
|
-
}
|
616
|
-
|
617
|
-
if (idProp) {
|
618
|
-
idField = me.model.prototype.fields.get(idProp);
|
619
|
-
if (idField) {
|
620
|
-
map = idField.mapping;
|
621
|
-
idProp = (map !== undefined && map !== null) ? map : idProp;
|
622
|
-
}
|
623
|
-
accessor = me.createAccessor(idProp);
|
624
|
-
|
625
|
-
me.getId = function(record) {
|
626
|
-
var id = accessor.call(me, record);
|
627
|
-
return (id === undefined || id === '') ? null : id;
|
628
|
-
};
|
629
|
-
} else {
|
630
|
-
me.getId = function() {
|
631
|
-
return null;
|
632
|
-
};
|
633
|
-
}
|
634
|
-
me.convertRecordData = me.buildRecordDataExtractor();
|
635
|
-
},
|
636
|
-
|
637
|
-
/**
|
638
|
-
* @private
|
639
|
-
* Return a function which will read a raw row object in the format this Reader accepts, and populates
|
640
|
-
* a record's data object with converted data values.
|
641
|
-
*
|
642
|
-
* The returned function must be passed the following parameters:
|
643
|
-
*
|
644
|
-
* - dest A record's empty data object into which the new field value properties are injected.
|
645
|
-
* - source A raw row data object of whatever type this Reader consumes
|
646
|
-
* - record The record which is being populated.
|
647
|
-
*
|
648
|
-
*/
|
649
|
-
buildRecordDataExtractor: function() {
|
650
|
-
var me = this,
|
651
|
-
modelProto = me.model.prototype,
|
652
|
-
clientIdProp = modelProto.clientIdProperty,
|
653
|
-
fields = modelProto.fields.items,
|
654
|
-
numFields = fields.length,
|
655
|
-
fieldVarName = [],
|
656
|
-
varName,
|
657
|
-
i = 0,
|
658
|
-
field,
|
659
|
-
code = [
|
660
|
-
'var me = this,\n',
|
661
|
-
' fields = me.model.prototype.fields,\n',
|
662
|
-
' value,\n',
|
663
|
-
' internalId'
|
664
|
-
];
|
665
|
-
|
666
|
-
for (i = 0; i < numFields; i++) {
|
667
|
-
field = fields[i];
|
668
|
-
fieldVarName[i] = '__field' + i;
|
669
|
-
code.push(',\n ', fieldVarName[i], ' = fields.get("', field.name, '")');
|
670
|
-
}
|
671
|
-
code.push(';\n\n return function(dest, source, record) {\n');
|
672
|
-
|
673
|
-
for (i = 0; i < numFields; i++) {
|
674
|
-
field = fields[i];
|
675
|
-
varName = fieldVarName[i];
|
676
|
-
// createFieldAccessExpression must be implemented in subclasses to extract data from the source object in the correct way.
|
677
|
-
code.push(' value = ', me.createFieldAccessExpression(field, varName, 'source'), ';\n');
|
678
|
-
|
679
|
-
// Code for processing a source property value when there is a default value.
|
680
|
-
if (field.defaultValue !== undefined) {
|
681
|
-
code.push(' if (value === undefined) {\n');
|
682
|
-
code.push(' if (me.applyDefaults) {\n');
|
683
|
-
code.push(' dest["' + field.name + '"] = ', (field.convert ? fieldVarName[i] + '.convert(' + fieldVarName[i] + '.defaultValue, record)' : (fieldVarName[i] + '.defaultValue')), ';\n');
|
684
|
-
code.push(' }\n');
|
685
|
-
code.push(' } else {\n');
|
686
|
-
code.push(' dest["' + field.name + '"] = ', (field.convert ? fieldVarName[i] + '.convert(value, record)' : 'value'), ';\n');
|
687
|
-
code.push(' }\n');
|
688
|
-
}
|
689
|
-
|
690
|
-
// Code for processing a source property value when there is no default value.
|
691
|
-
else {
|
692
|
-
code.push(' if (value !== undefined) {\n');
|
693
|
-
code.push(' dest["' + field.name + '"] = ', (field.convert ? fieldVarName[i] + '.convert(value, record)' : 'value'), ';\n');
|
694
|
-
code.push(' }\n');
|
695
|
-
}
|
696
|
-
}
|
697
|
-
|
698
|
-
// set the client id as the internalId of the record.
|
699
|
-
// clientId handles the case where a client side record did not previously exist on the server,
|
700
|
-
// so the server is passing back a client id that can be used to pair the server side record up with the client record
|
701
|
-
if (clientIdProp) {
|
702
|
-
code.push(' if (record && (internalId = ' + me.createFieldAccessExpression({mapping: clientIdProp}, null, 'source') + ')) {\n');
|
703
|
-
code.push(' record.internalId = internalId;\n }\n');
|
704
|
-
}
|
705
|
-
|
706
|
-
code.push(' };');
|
707
|
-
|
708
|
-
// Here we are creating a new Function and invoking it immediately in the scope of this Reader
|
709
|
-
// It declares several vars capturing the configured context of this Reader, and returns a function
|
710
|
-
// which, when passed a record data object, a raw data row in the format this Reader is configured to read,
|
711
|
-
// and the record which is being created, will populate the record's data object from the raw row data.
|
712
|
-
return Ext.functionFactory(code.join('')).call(me);
|
713
|
-
},
|
714
|
-
|
715
|
-
destroyReader: function() {
|
716
|
-
var me = this;
|
717
|
-
delete me.proxy;
|
718
|
-
delete me.model;
|
719
|
-
delete me.convertRecordData;
|
720
|
-
delete me.getId;
|
721
|
-
delete me.getTotal;
|
722
|
-
delete me.getSuccess;
|
723
|
-
delete me.getMessage;
|
724
|
-
}
|
725
|
-
}, function() {
|
726
|
-
Ext.apply(this.prototype, {
|
727
|
-
// Private. Empty ResultSet to return when response is falsy (null|undefined|empty string)
|
728
|
-
nullResultSet: new Ext.data.ResultSet({
|
729
|
-
total : 0,
|
730
|
-
count : 0,
|
731
|
-
records: [],
|
732
|
-
success: true
|
733
|
-
})
|
734
|
-
});
|
735
|
-
});
|