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,1294 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* This class is used as a set of methods that are applied to the prototype of a
|
3
|
-
* Model to decorate it with a Node API. This means that models used in conjunction with a tree
|
4
|
-
* will have all of the tree related methods available on the model. In general this class will
|
5
|
-
* not be used directly by the developer. This class also creates extra fields on the model if
|
6
|
-
* they do not exist, to help maintain the tree state and UI. These fields are documented as
|
7
|
-
* config options.
|
8
|
-
*/
|
9
|
-
Ext.define('Ext.data.NodeInterface', {
|
10
|
-
requires: ['Ext.data.Field'],
|
11
|
-
|
12
|
-
/**
|
13
|
-
* @cfg {String} parentId
|
14
|
-
* ID of parent node.
|
15
|
-
*/
|
16
|
-
|
17
|
-
/**
|
18
|
-
* @cfg {Number} index
|
19
|
-
* The position of the node inside its parent. When parent has 4 children and the node is third amongst them,
|
20
|
-
* index will be 2.
|
21
|
-
*/
|
22
|
-
|
23
|
-
/**
|
24
|
-
* @cfg {Number} depth
|
25
|
-
* The number of parents this node has. A root node has depth 0, a child of it depth 1, and so on...
|
26
|
-
*/
|
27
|
-
|
28
|
-
/**
|
29
|
-
* @cfg {Boolean} [expanded=false]
|
30
|
-
* True if the node is expanded.
|
31
|
-
*/
|
32
|
-
|
33
|
-
/**
|
34
|
-
* @cfg {Boolean} [expandable=false]
|
35
|
-
* Set to true to allow for expanding/collapsing of this node.
|
36
|
-
*/
|
37
|
-
|
38
|
-
/**
|
39
|
-
* @cfg {Boolean} [checked=null]
|
40
|
-
* Set to true or false to show a checkbox alongside this node.
|
41
|
-
*/
|
42
|
-
|
43
|
-
/**
|
44
|
-
* @cfg {Boolean} [leaf=false]
|
45
|
-
* Set to true to indicate that this child can have no children. The expand icon/arrow will then not be
|
46
|
-
* rendered for this node.
|
47
|
-
*/
|
48
|
-
|
49
|
-
/**
|
50
|
-
* @cfg {String} cls
|
51
|
-
* CSS class to apply for this node.
|
52
|
-
*/
|
53
|
-
|
54
|
-
/**
|
55
|
-
* @cfg {String} iconCls
|
56
|
-
* CSS class to apply for this node's icon.
|
57
|
-
*/
|
58
|
-
|
59
|
-
/**
|
60
|
-
* @cfg {String} icon
|
61
|
-
* URL for this node's icon.
|
62
|
-
*/
|
63
|
-
|
64
|
-
/**
|
65
|
-
* @cfg {Boolean} root
|
66
|
-
* True if this is the root node.
|
67
|
-
*/
|
68
|
-
|
69
|
-
/**
|
70
|
-
* @cfg {Boolean} isLast
|
71
|
-
* True if this is the last node.
|
72
|
-
*/
|
73
|
-
|
74
|
-
/**
|
75
|
-
* @cfg {Boolean} isFirst
|
76
|
-
* True if this is the first node.
|
77
|
-
*/
|
78
|
-
|
79
|
-
/**
|
80
|
-
* @cfg {Boolean} [allowDrop=true]
|
81
|
-
* Set to false to deny dropping on this node.
|
82
|
-
*/
|
83
|
-
|
84
|
-
/**
|
85
|
-
* @cfg {Boolean} [allowDrag=true]
|
86
|
-
* Set to false to deny dragging of this node.
|
87
|
-
*/
|
88
|
-
|
89
|
-
/**
|
90
|
-
* @cfg {Boolean} [loaded=false]
|
91
|
-
* True if the node has finished loading.
|
92
|
-
*/
|
93
|
-
|
94
|
-
/**
|
95
|
-
* @cfg {Boolean} [loading=false]
|
96
|
-
* True if the node is currently loading.
|
97
|
-
*/
|
98
|
-
|
99
|
-
/**
|
100
|
-
* @cfg {String} href
|
101
|
-
* An URL for a link that's created when this config is specified.
|
102
|
-
*/
|
103
|
-
|
104
|
-
/**
|
105
|
-
* @cfg {String} hrefTarget
|
106
|
-
* Target for link. Only applicable when {@link #href} also specified.
|
107
|
-
*/
|
108
|
-
|
109
|
-
/**
|
110
|
-
* @cfg {String} qtip
|
111
|
-
* Tooltip text to show on this node.
|
112
|
-
*/
|
113
|
-
|
114
|
-
/**
|
115
|
-
* @cfg {String} qtitle
|
116
|
-
* Tooltip title.
|
117
|
-
*/
|
118
|
-
|
119
|
-
/**
|
120
|
-
* @cfg {String} text
|
121
|
-
* The text for to show on node label.
|
122
|
-
*/
|
123
|
-
|
124
|
-
/**
|
125
|
-
* @cfg {Ext.data.NodeInterface[]} children
|
126
|
-
* Array of child nodes.
|
127
|
-
*/
|
128
|
-
|
129
|
-
|
130
|
-
/**
|
131
|
-
* @property nextSibling
|
132
|
-
* A reference to this node's next sibling node. `null` if this node does not have a next sibling.
|
133
|
-
*/
|
134
|
-
|
135
|
-
/**
|
136
|
-
* @property previousSibling
|
137
|
-
* A reference to this node's previous sibling node. `null` if this node does not have a previous sibling.
|
138
|
-
*/
|
139
|
-
|
140
|
-
/**
|
141
|
-
* @property parentNode
|
142
|
-
* A reference to this node's parent node. `null` if this node is the root node.
|
143
|
-
*/
|
144
|
-
|
145
|
-
/**
|
146
|
-
* @property lastChild
|
147
|
-
* A reference to this node's last child node. `null` if this node has no children.
|
148
|
-
*/
|
149
|
-
|
150
|
-
/**
|
151
|
-
* @property firstChild
|
152
|
-
* A reference to this node's first child node. `null` if this node has no children.
|
153
|
-
*/
|
154
|
-
|
155
|
-
/**
|
156
|
-
* @property childNodes
|
157
|
-
* An array of this nodes children. Array will be empty if this node has no chidren.
|
158
|
-
*/
|
159
|
-
|
160
|
-
statics: {
|
161
|
-
/**
|
162
|
-
* This method allows you to decorate a Model's class to implement the NodeInterface.
|
163
|
-
* This adds a set of methods, new events, new properties and new fields on every Record.
|
164
|
-
* @param {Ext.Class/Ext.data.Model} modelClass The Model class or an instance of the Model class you want to
|
165
|
-
* decorate the prototype of.
|
166
|
-
* @static
|
167
|
-
*/
|
168
|
-
decorate: function(modelClass) {
|
169
|
-
var idName, idType;
|
170
|
-
|
171
|
-
// get the reference to the model class, in case the argument was a string or a record
|
172
|
-
if (typeof modelClass == 'string') {
|
173
|
-
modelClass = Ext.ModelManager.getModel(modelClass);
|
174
|
-
} else if (modelClass.isModel) {
|
175
|
-
modelClass = Ext.ModelManager.getModel(modelClass.modelName);
|
176
|
-
}
|
177
|
-
|
178
|
-
// avoid unnecessary work in case the model was already decorated
|
179
|
-
if (modelClass.prototype.isNode) {
|
180
|
-
return;
|
181
|
-
}
|
182
|
-
|
183
|
-
idName = modelClass.prototype.idProperty;
|
184
|
-
idType = modelClass.prototype.fields.get(idName).type.type;
|
185
|
-
modelClass.override(this.getPrototypeBody());
|
186
|
-
this.applyFields(modelClass, [
|
187
|
-
{name: 'parentId', type: idType, defaultValue: null},
|
188
|
-
{name: 'index', type: 'int', defaultValue: null, persist: false},
|
189
|
-
{name: 'depth', type: 'int', defaultValue: 0, persist: false},
|
190
|
-
{name: 'expanded', type: 'bool', defaultValue: false, persist: false},
|
191
|
-
{name: 'expandable', type: 'bool', defaultValue: true, persist: false},
|
192
|
-
{name: 'checked', type: 'auto', defaultValue: null, persist: false},
|
193
|
-
{name: 'leaf', type: 'bool', defaultValue: false},
|
194
|
-
{name: 'cls', type: 'string', defaultValue: null, persist: false},
|
195
|
-
{name: 'iconCls', type: 'string', defaultValue: null, persist: false},
|
196
|
-
{name: 'icon', type: 'string', defaultValue: null, persist: false},
|
197
|
-
{name: 'root', type: 'boolean', defaultValue: false, persist: false},
|
198
|
-
{name: 'isLast', type: 'boolean', defaultValue: false, persist: false},
|
199
|
-
{name: 'isFirst', type: 'boolean', defaultValue: false, persist: false},
|
200
|
-
{name: 'allowDrop', type: 'boolean', defaultValue: true, persist: false},
|
201
|
-
{name: 'allowDrag', type: 'boolean', defaultValue: true, persist: false},
|
202
|
-
{name: 'loaded', type: 'boolean', defaultValue: false, persist: false},
|
203
|
-
{name: 'loading', type: 'boolean', defaultValue: false, persist: false},
|
204
|
-
{name: 'href', type: 'string', defaultValue: null, persist: false},
|
205
|
-
{name: 'hrefTarget', type: 'string', defaultValue: null, persist: false},
|
206
|
-
{name: 'qtip', type: 'string', defaultValue: null, persist: false},
|
207
|
-
{name: 'qtitle', type: 'string', defaultValue: null, persist: false},
|
208
|
-
{name: 'children', type: 'auto', defaultValue: null, persist: false}
|
209
|
-
]);
|
210
|
-
},
|
211
|
-
|
212
|
-
applyFields: function(modelClass, addFields) {
|
213
|
-
var modelPrototype = modelClass.prototype,
|
214
|
-
fields = modelPrototype.fields,
|
215
|
-
keys = fields.keys,
|
216
|
-
ln = addFields.length,
|
217
|
-
addField, i;
|
218
|
-
|
219
|
-
for (i = 0; i < ln; i++) {
|
220
|
-
addField = addFields[i];
|
221
|
-
if (!Ext.Array.contains(keys, addField.name)) {
|
222
|
-
fields.add(new Ext.data.Field(addField));
|
223
|
-
}
|
224
|
-
}
|
225
|
-
|
226
|
-
},
|
227
|
-
|
228
|
-
getPrototypeBody: function() {
|
229
|
-
return {
|
230
|
-
/**
|
231
|
-
* @property {Boolean} isNode
|
232
|
-
* `true` in this class to identify an object as an instantiated Node, or subclass thereof.
|
233
|
-
*/
|
234
|
-
isNode: true,
|
235
|
-
|
236
|
-
constructor: function() {
|
237
|
-
var me = this;
|
238
|
-
this.callParent(arguments);
|
239
|
-
Ext.applyIf(me, {
|
240
|
-
firstChild: null,
|
241
|
-
lastChild: null,
|
242
|
-
parentNode: null,
|
243
|
-
previousSibling: null,
|
244
|
-
nextSibling: null,
|
245
|
-
childNodes: []
|
246
|
-
});
|
247
|
-
me.enableBubble([
|
248
|
-
/**
|
249
|
-
* @event append
|
250
|
-
* Fires when a new child node is appended
|
251
|
-
* @param {Ext.data.NodeInterface} this This node
|
252
|
-
* @param {Ext.data.NodeInterface} node The newly appended node
|
253
|
-
* @param {Number} index The index of the newly appended node
|
254
|
-
*/
|
255
|
-
"append",
|
256
|
-
|
257
|
-
/**
|
258
|
-
* @event remove
|
259
|
-
* Fires when a child node is removed
|
260
|
-
* @param {Ext.data.NodeInterface} this This node
|
261
|
-
* @param {Ext.data.NodeInterface} node The removed node
|
262
|
-
* @param {Boolean} isMove `true` if the child node is being removed so it can be moved to another position in the tree.
|
263
|
-
* (a side effect of calling {@link #appendChild} or {@link #insertBefore} with a node that already has a parentNode
|
264
|
-
*/
|
265
|
-
"remove",
|
266
|
-
|
267
|
-
/**
|
268
|
-
* @event move
|
269
|
-
* Fires when this node is moved to a new location in the tree
|
270
|
-
* @param {Ext.data.NodeInterface} this This node
|
271
|
-
* @param {Ext.data.NodeInterface} oldParent The old parent of this node
|
272
|
-
* @param {Ext.data.NodeInterface} newParent The new parent of this node
|
273
|
-
* @param {Number} index The index it was moved to
|
274
|
-
*/
|
275
|
-
"move",
|
276
|
-
|
277
|
-
/**
|
278
|
-
* @event insert
|
279
|
-
* Fires when a new child node is inserted.
|
280
|
-
* @param {Ext.data.NodeInterface} this This node
|
281
|
-
* @param {Ext.data.NodeInterface} node The child node inserted
|
282
|
-
* @param {Ext.data.NodeInterface} refNode The child node the node was inserted before
|
283
|
-
*/
|
284
|
-
"insert",
|
285
|
-
|
286
|
-
/**
|
287
|
-
* @event beforeappend
|
288
|
-
* Fires before a new child is appended, return false to cancel the append.
|
289
|
-
* @param {Ext.data.NodeInterface} this This node
|
290
|
-
* @param {Ext.data.NodeInterface} node The child node to be appended
|
291
|
-
*/
|
292
|
-
"beforeappend",
|
293
|
-
|
294
|
-
/**
|
295
|
-
* @event beforeremove
|
296
|
-
* Fires before a child is removed, return false to cancel the remove.
|
297
|
-
* @param {Ext.data.NodeInterface} this This node
|
298
|
-
* @param {Ext.data.NodeInterface} node The child node to be removed
|
299
|
-
* @param {Boolean} isMove `true` if the child node is being removed so it can be moved to another position in the tree.
|
300
|
-
* (a side effect of calling {@link #appendChild} or {@link #insertBefore} with a node that already has a parentNode
|
301
|
-
*/
|
302
|
-
"beforeremove",
|
303
|
-
|
304
|
-
/**
|
305
|
-
* @event beforemove
|
306
|
-
* Fires before this node is moved to a new location in the tree. Return false to cancel the move.
|
307
|
-
* @param {Ext.data.NodeInterface} this This node
|
308
|
-
* @param {Ext.data.NodeInterface} oldParent The parent of this node
|
309
|
-
* @param {Ext.data.NodeInterface} newParent The new parent this node is moving to
|
310
|
-
* @param {Number} index The index it is being moved to
|
311
|
-
*/
|
312
|
-
"beforemove",
|
313
|
-
|
314
|
-
/**
|
315
|
-
* @event beforeinsert
|
316
|
-
* Fires before a new child is inserted, return false to cancel the insert.
|
317
|
-
* @param {Ext.data.NodeInterface} this This node
|
318
|
-
* @param {Ext.data.NodeInterface} node The child node to be inserted
|
319
|
-
* @param {Ext.data.NodeInterface} refNode The child node the node is being inserted before
|
320
|
-
*/
|
321
|
-
"beforeinsert",
|
322
|
-
|
323
|
-
/**
|
324
|
-
* @event expand
|
325
|
-
* Fires when this node is expanded.
|
326
|
-
* @param {Ext.data.NodeInterface} this The expanding node
|
327
|
-
*/
|
328
|
-
"expand",
|
329
|
-
|
330
|
-
/**
|
331
|
-
* @event collapse
|
332
|
-
* Fires when this node is collapsed.
|
333
|
-
* @param {Ext.data.NodeInterface} this The collapsing node
|
334
|
-
*/
|
335
|
-
"collapse",
|
336
|
-
|
337
|
-
/**
|
338
|
-
* @event beforeexpand
|
339
|
-
* Fires before this node is expanded.
|
340
|
-
* @param {Ext.data.NodeInterface} this The expanding node
|
341
|
-
*/
|
342
|
-
"beforeexpand",
|
343
|
-
|
344
|
-
/**
|
345
|
-
* @event beforecollapse
|
346
|
-
* Fires before this node is collapsed.
|
347
|
-
* @param {Ext.data.NodeInterface} this The collapsing node
|
348
|
-
*/
|
349
|
-
"beforecollapse",
|
350
|
-
|
351
|
-
/**
|
352
|
-
* @event sort
|
353
|
-
* Fires when this node's childNodes are sorted.
|
354
|
-
* @param {Ext.data.NodeInterface} this This node.
|
355
|
-
* @param {Ext.data.NodeInterface[]} childNodes The childNodes of this node.
|
356
|
-
*/
|
357
|
-
"sort"
|
358
|
-
]);
|
359
|
-
return me;
|
360
|
-
},
|
361
|
-
/**
|
362
|
-
* Ensures that the passed object is an instance of a Record with the NodeInterface applied
|
363
|
-
* @return {Boolean}
|
364
|
-
*/
|
365
|
-
createNode: function(node) {
|
366
|
-
if (Ext.isObject(node) && !node.isModel) {
|
367
|
-
node = Ext.ModelManager.create(node, this.modelName);
|
368
|
-
}
|
369
|
-
return node;
|
370
|
-
},
|
371
|
-
|
372
|
-
/**
|
373
|
-
* Returns true if this node is a leaf
|
374
|
-
* @return {Boolean}
|
375
|
-
*/
|
376
|
-
isLeaf : function() {
|
377
|
-
return this.get('leaf') === true;
|
378
|
-
},
|
379
|
-
|
380
|
-
/**
|
381
|
-
* Sets the first child of this node
|
382
|
-
* @private
|
383
|
-
* @param {Ext.data.NodeInterface} node
|
384
|
-
*/
|
385
|
-
setFirstChild : function(node) {
|
386
|
-
this.firstChild = node;
|
387
|
-
},
|
388
|
-
|
389
|
-
/**
|
390
|
-
* Sets the last child of this node
|
391
|
-
* @private
|
392
|
-
* @param {Ext.data.NodeInterface} node
|
393
|
-
*/
|
394
|
-
setLastChild : function(node) {
|
395
|
-
this.lastChild = node;
|
396
|
-
},
|
397
|
-
|
398
|
-
/**
|
399
|
-
* Updates general data of this node like isFirst, isLast, depth. This
|
400
|
-
* method is internally called after a node is moved. This shouldn't
|
401
|
-
* have to be called by the developer unless they are creating custom
|
402
|
-
* Tree plugins.
|
403
|
-
* @return {Boolean}
|
404
|
-
*/
|
405
|
-
updateInfo: function(commit) {
|
406
|
-
var me = this,
|
407
|
-
isRoot = me.isRoot(),
|
408
|
-
parentNode = me.parentNode,
|
409
|
-
isFirst = (!parentNode || isRoot ? true : parentNode.firstChild === me),
|
410
|
-
isLast = (!parentNode || isRoot ? true : parentNode.lastChild === me),
|
411
|
-
depth = 0,
|
412
|
-
parent = me,
|
413
|
-
children = me.childNodes,
|
414
|
-
len = children.length,
|
415
|
-
i = 0,
|
416
|
-
phantom = me.phantom;
|
417
|
-
|
418
|
-
while (parent.parentNode) {
|
419
|
-
++depth;
|
420
|
-
parent = parent.parentNode;
|
421
|
-
}
|
422
|
-
|
423
|
-
me.beginEdit();
|
424
|
-
me.set({
|
425
|
-
isFirst: isFirst,
|
426
|
-
isLast: isLast,
|
427
|
-
depth: depth,
|
428
|
-
index: parentNode ? parentNode.indexOf(me) : 0,
|
429
|
-
parentId: parentNode ? parentNode.getId() : null
|
430
|
-
});
|
431
|
-
me.endEdit(true);
|
432
|
-
if (commit) {
|
433
|
-
me.commit();
|
434
|
-
me.phantom = phantom;
|
435
|
-
}
|
436
|
-
|
437
|
-
for (i = 0; i < len; i++) {
|
438
|
-
children[i].updateInfo(commit);
|
439
|
-
}
|
440
|
-
},
|
441
|
-
|
442
|
-
/**
|
443
|
-
* Returns true if this node is the last child of its parent
|
444
|
-
* @return {Boolean}
|
445
|
-
*/
|
446
|
-
isLast : function() {
|
447
|
-
return this.get('isLast');
|
448
|
-
},
|
449
|
-
|
450
|
-
/**
|
451
|
-
* Returns true if this node is the first child of its parent
|
452
|
-
* @return {Boolean}
|
453
|
-
*/
|
454
|
-
isFirst : function() {
|
455
|
-
return this.get('isFirst');
|
456
|
-
},
|
457
|
-
|
458
|
-
/**
|
459
|
-
* Returns true if this node has one or more child nodes, else false.
|
460
|
-
* @return {Boolean}
|
461
|
-
*/
|
462
|
-
hasChildNodes : function() {
|
463
|
-
return !this.isLeaf() && this.childNodes.length > 0;
|
464
|
-
},
|
465
|
-
|
466
|
-
/**
|
467
|
-
* Returns true if this node has one or more child nodes, or if the <tt>expandable</tt>
|
468
|
-
* node attribute is explicitly specified as true, otherwise returns false.
|
469
|
-
* @return {Boolean}
|
470
|
-
*/
|
471
|
-
isExpandable : function() {
|
472
|
-
var me = this;
|
473
|
-
|
474
|
-
if (me.get('expandable')) {
|
475
|
-
return !(me.isLeaf() || (me.isLoaded() && !me.hasChildNodes()));
|
476
|
-
}
|
477
|
-
return false;
|
478
|
-
},
|
479
|
-
|
480
|
-
/**
|
481
|
-
* Inserts node(s) as the last child node of this node.
|
482
|
-
*
|
483
|
-
* If the node was previously a child node of another parent node, it will be removed from that node first.
|
484
|
-
*
|
485
|
-
* @param {Ext.data.NodeInterface/Ext.data.NodeInterface[]} node The node or Array of nodes to append
|
486
|
-
* @return {Ext.data.NodeInterface} The appended node if single append, or null if an array was passed
|
487
|
-
*/
|
488
|
-
appendChild : function(node, suppressEvents, commit) {
|
489
|
-
var me = this,
|
490
|
-
i, ln,
|
491
|
-
index,
|
492
|
-
oldParent,
|
493
|
-
ps;
|
494
|
-
|
495
|
-
// if passed an array do them one by one
|
496
|
-
if (Ext.isArray(node)) {
|
497
|
-
// suspend auto syncing while we append all the nodes
|
498
|
-
me.callStore('suspendAutoSync');
|
499
|
-
for (i = 0, ln = node.length - 1; i < ln; i++) {
|
500
|
-
me.appendChild(node[i]);
|
501
|
-
}
|
502
|
-
// resume auto syncing before we append the last node
|
503
|
-
me.callStore('resumeAutoSync');
|
504
|
-
me.appendChild(node[ln]);
|
505
|
-
} else {
|
506
|
-
// Make sure it is a record
|
507
|
-
node = me.createNode(node);
|
508
|
-
|
509
|
-
if (suppressEvents !== true && (!me.hasListeners.beforeappend || me.fireEvent("beforeappend", me, node) === false)) {
|
510
|
-
return false;
|
511
|
-
}
|
512
|
-
|
513
|
-
index = me.childNodes.length;
|
514
|
-
oldParent = node.parentNode;
|
515
|
-
|
516
|
-
// it's a move, make sure we move it cleanly
|
517
|
-
if (oldParent) {
|
518
|
-
if (suppressEvents !== true && (!me.hasListeners.beforeremove || node.fireEvent("beforemove", node, oldParent, me, index) === false)) {
|
519
|
-
return false;
|
520
|
-
}
|
521
|
-
oldParent.removeChild(node, false, false, true);
|
522
|
-
}
|
523
|
-
|
524
|
-
index = me.childNodes.length;
|
525
|
-
if (index === 0) {
|
526
|
-
me.setFirstChild(node);
|
527
|
-
}
|
528
|
-
|
529
|
-
me.childNodes.push(node);
|
530
|
-
node.parentNode = me;
|
531
|
-
node.nextSibling = null;
|
532
|
-
|
533
|
-
me.setLastChild(node);
|
534
|
-
|
535
|
-
ps = me.childNodes[index - 1];
|
536
|
-
if (ps) {
|
537
|
-
node.previousSibling = ps;
|
538
|
-
ps.nextSibling = node;
|
539
|
-
ps.updateInfo(commit);
|
540
|
-
} else {
|
541
|
-
node.previousSibling = null;
|
542
|
-
}
|
543
|
-
|
544
|
-
node.updateInfo(commit);
|
545
|
-
|
546
|
-
// As soon as we append a child to this node, we are loaded
|
547
|
-
if (!me.isLoaded()) {
|
548
|
-
me.set('loaded', true);
|
549
|
-
} else if (me.childNodes.length === 1) {
|
550
|
-
// This isn't ideal, however none of the underlying fields have changed
|
551
|
-
// but we still need to update the UI
|
552
|
-
me.afterEdit([]);
|
553
|
-
}
|
554
|
-
|
555
|
-
if(!node.isLeaf() && node.phantom) {
|
556
|
-
node.set('loaded', true);
|
557
|
-
}
|
558
|
-
|
559
|
-
if (suppressEvents !== true) {
|
560
|
-
me.fireEvent("append", me, node, index);
|
561
|
-
|
562
|
-
if (oldParent) {
|
563
|
-
node.fireEvent("move", node, oldParent, me, index);
|
564
|
-
}
|
565
|
-
}
|
566
|
-
|
567
|
-
return node;
|
568
|
-
}
|
569
|
-
},
|
570
|
-
|
571
|
-
/**
|
572
|
-
* Returns the bubble target for this node
|
573
|
-
* @private
|
574
|
-
* @return {Object} The bubble target
|
575
|
-
*/
|
576
|
-
getBubbleTarget: function() {
|
577
|
-
return this.parentNode;
|
578
|
-
},
|
579
|
-
|
580
|
-
/**
|
581
|
-
* Removes a child node from this node.
|
582
|
-
* @param {Ext.data.NodeInterface} node The node to remove
|
583
|
-
* @param {Boolean} [destroy=false] True to destroy the node upon removal.
|
584
|
-
* @return {Ext.data.NodeInterface} The removed node
|
585
|
-
*/
|
586
|
-
removeChild : function(node, destroy, suppressEvents, isMove) {
|
587
|
-
var me = this,
|
588
|
-
index = me.indexOf(node),
|
589
|
-
i, childCount;
|
590
|
-
|
591
|
-
if (index == -1 || (suppressEvents !== true && (!me.hasListeners.beforeremove || me.fireEvent("beforeremove", me, node, !!isMove) === false))) {
|
592
|
-
return false;
|
593
|
-
}
|
594
|
-
|
595
|
-
// remove it from childNodes collection
|
596
|
-
Ext.Array.erase(me.childNodes, index, 1);
|
597
|
-
|
598
|
-
// update child refs
|
599
|
-
if (me.firstChild == node) {
|
600
|
-
me.setFirstChild(node.nextSibling);
|
601
|
-
}
|
602
|
-
if (me.lastChild == node) {
|
603
|
-
me.setLastChild(node.previousSibling);
|
604
|
-
}
|
605
|
-
|
606
|
-
// update siblings
|
607
|
-
if (node.previousSibling) {
|
608
|
-
node.previousSibling.nextSibling = node.nextSibling;
|
609
|
-
}
|
610
|
-
if (node.nextSibling) {
|
611
|
-
node.nextSibling.previousSibling = node.previousSibling;
|
612
|
-
}
|
613
|
-
|
614
|
-
// update the info for all siblings starting at the index before the node's old index (or 0 if the removed node was the firstChild)
|
615
|
-
for(i = index > 0 ? index - 1 : 0, childCount = me.childNodes.length; i < childCount; i++) {
|
616
|
-
me.childNodes[i].updateInfo();
|
617
|
-
}
|
618
|
-
|
619
|
-
// If this node suddenly doesnt have childnodes anymore, update myself
|
620
|
-
if (!me.childNodes.length) {
|
621
|
-
me.set('loaded', me.isLoaded());
|
622
|
-
}
|
623
|
-
|
624
|
-
if (suppressEvents !== true) {
|
625
|
-
if (me.hasListeners.remove) {
|
626
|
-
me.fireEvent("remove", me, node, !!isMove);
|
627
|
-
}
|
628
|
-
}
|
629
|
-
|
630
|
-
if (destroy) {
|
631
|
-
node.destroy(true);
|
632
|
-
} else {
|
633
|
-
node.clear();
|
634
|
-
}
|
635
|
-
|
636
|
-
return node;
|
637
|
-
},
|
638
|
-
|
639
|
-
/**
|
640
|
-
* Creates a copy (clone) of this Node.
|
641
|
-
* @param {String} [id] A new id, defaults to this Node's id.
|
642
|
-
* @param {Boolean} [deep=false] True to recursively copy all child Nodes into the new Node.
|
643
|
-
* False to copy without child Nodes.
|
644
|
-
* @return {Ext.data.NodeInterface} A copy of this Node.
|
645
|
-
*/
|
646
|
-
copy: function(newId, deep) {
|
647
|
-
var me = this,
|
648
|
-
result = me.callOverridden(arguments),
|
649
|
-
len = me.childNodes ? me.childNodes.length : 0,
|
650
|
-
i;
|
651
|
-
|
652
|
-
// Move child nodes across to the copy if required
|
653
|
-
if (deep) {
|
654
|
-
for (i = 0; i < len; i++) {
|
655
|
-
result.appendChild(me.childNodes[i].copy(true));
|
656
|
-
}
|
657
|
-
}
|
658
|
-
return result;
|
659
|
-
},
|
660
|
-
|
661
|
-
/**
|
662
|
-
* Clears the node.
|
663
|
-
* @private
|
664
|
-
* @param {Boolean} [destroy=false] True to destroy the node.
|
665
|
-
*/
|
666
|
-
clear : function(destroy) {
|
667
|
-
var me = this;
|
668
|
-
|
669
|
-
// clear any references from the node
|
670
|
-
me.parentNode = me.previousSibling = me.nextSibling = null;
|
671
|
-
if (destroy) {
|
672
|
-
me.firstChild = me.lastChild = null;
|
673
|
-
}
|
674
|
-
},
|
675
|
-
|
676
|
-
/**
|
677
|
-
* Destroys the node.
|
678
|
-
*/
|
679
|
-
destroy : function(silent) {
|
680
|
-
/*
|
681
|
-
* Silent is to be used in a number of cases
|
682
|
-
* 1) When setRoot is called.
|
683
|
-
* 2) When destroy on the tree is called
|
684
|
-
* 3) For destroying child nodes on a node
|
685
|
-
*/
|
686
|
-
var me = this,
|
687
|
-
options = me.destroyOptions,
|
688
|
-
nodes = me.childNodes,
|
689
|
-
nLen = nodes.length,
|
690
|
-
n;
|
691
|
-
|
692
|
-
if (silent === true) {
|
693
|
-
me.clear(true);
|
694
|
-
|
695
|
-
for (n = 0; n < nLen; n++) {
|
696
|
-
nodes[n].destroy(true);
|
697
|
-
}
|
698
|
-
|
699
|
-
me.childNodes = null;
|
700
|
-
delete me.destroyOptions;
|
701
|
-
me.callOverridden([options]);
|
702
|
-
} else {
|
703
|
-
me.destroyOptions = silent;
|
704
|
-
// overridden method will be called, since remove will end up calling destroy(true);
|
705
|
-
me.remove(true);
|
706
|
-
}
|
707
|
-
},
|
708
|
-
|
709
|
-
/**
|
710
|
-
* Inserts the first node before the second node in this nodes childNodes collection.
|
711
|
-
* @param {Ext.data.NodeInterface} node The node to insert
|
712
|
-
* @param {Ext.data.NodeInterface} refNode The node to insert before (if null the node is appended)
|
713
|
-
* @return {Ext.data.NodeInterface} The inserted node
|
714
|
-
*/
|
715
|
-
insertBefore : function(node, refNode, suppressEvents) {
|
716
|
-
var me = this,
|
717
|
-
index = me.indexOf(refNode),
|
718
|
-
oldParent = node.parentNode,
|
719
|
-
refIndex = index,
|
720
|
-
childCount, ps, i;
|
721
|
-
|
722
|
-
if (!refNode) { // like standard Dom, refNode can be null for append
|
723
|
-
return me.appendChild(node);
|
724
|
-
}
|
725
|
-
|
726
|
-
// nothing to do
|
727
|
-
if (node == refNode) {
|
728
|
-
return false;
|
729
|
-
}
|
730
|
-
|
731
|
-
// Make sure it is a record with the NodeInterface
|
732
|
-
node = me.createNode(node);
|
733
|
-
|
734
|
-
if (suppressEvents !== true && (!me.hasListeners.beforeinsert || me.fireEvent("beforeinsert", me, node, refNode) === false)) {
|
735
|
-
return false;
|
736
|
-
}
|
737
|
-
|
738
|
-
// when moving internally, indexes will change after remove
|
739
|
-
if (oldParent == me && me.indexOf(node) < index) {
|
740
|
-
refIndex--;
|
741
|
-
}
|
742
|
-
|
743
|
-
// it's a move, make sure we move it cleanly
|
744
|
-
if (oldParent) {
|
745
|
-
if (suppressEvents !== true && (!me.hasListeners.beforeremove || node.fireEvent("beforemove", node, oldParent, me, index, refNode) === false)) {
|
746
|
-
return false;
|
747
|
-
}
|
748
|
-
oldParent.removeChild(node, false, false, true);
|
749
|
-
}
|
750
|
-
|
751
|
-
if (refIndex === 0) {
|
752
|
-
me.setFirstChild(node);
|
753
|
-
}
|
754
|
-
|
755
|
-
Ext.Array.splice(me.childNodes, refIndex, 0, node);
|
756
|
-
node.parentNode = me;
|
757
|
-
|
758
|
-
node.nextSibling = refNode;
|
759
|
-
refNode.previousSibling = node;
|
760
|
-
|
761
|
-
ps = me.childNodes[refIndex - 1];
|
762
|
-
if (ps) {
|
763
|
-
node.previousSibling = ps;
|
764
|
-
ps.nextSibling = node;
|
765
|
-
} else {
|
766
|
-
node.previousSibling = null;
|
767
|
-
}
|
768
|
-
|
769
|
-
// update the info for all siblings starting at the index before the node's insertion point (or 0 if the inserted node is the firstChild)
|
770
|
-
for(i = refIndex > 0 ? refIndex - 1 : 0, childCount = me.childNodes.length; i < childCount; i++) {
|
771
|
-
me.childNodes[i].updateInfo();
|
772
|
-
}
|
773
|
-
|
774
|
-
if (!me.isLoaded()) {
|
775
|
-
me.set('loaded', true);
|
776
|
-
}
|
777
|
-
// If this node didnt have any childnodes before, update myself
|
778
|
-
else if (me.childNodes.length === 1) {
|
779
|
-
me.set('loaded', me.isLoaded());
|
780
|
-
}
|
781
|
-
|
782
|
-
if(!node.isLeaf() && node.phantom) {
|
783
|
-
node.set('loaded', true);
|
784
|
-
}
|
785
|
-
|
786
|
-
if (suppressEvents !== true) {
|
787
|
-
if (me.hasListeners.insert) {
|
788
|
-
me.fireEvent("insert", me, node, refNode);
|
789
|
-
}
|
790
|
-
|
791
|
-
if (oldParent && me.hasListeners.move) {
|
792
|
-
node.fireEvent("move", node, oldParent, me, refIndex, refNode);
|
793
|
-
}
|
794
|
-
}
|
795
|
-
|
796
|
-
return node;
|
797
|
-
},
|
798
|
-
|
799
|
-
/**
|
800
|
-
* Insert a node into this node
|
801
|
-
* @param {Number} index The zero-based index to insert the node at
|
802
|
-
* @param {Ext.data.Model} node The node to insert
|
803
|
-
* @return {Ext.data.Model} The record you just inserted
|
804
|
-
*/
|
805
|
-
insertChild: function(index, node) {
|
806
|
-
var sibling = this.childNodes[index];
|
807
|
-
if (sibling) {
|
808
|
-
return this.insertBefore(node, sibling);
|
809
|
-
}
|
810
|
-
else {
|
811
|
-
return this.appendChild(node);
|
812
|
-
}
|
813
|
-
},
|
814
|
-
|
815
|
-
/**
|
816
|
-
* Removes this node from its parent
|
817
|
-
* @param {Boolean} [destroy=false] True to destroy the node upon removal.
|
818
|
-
* @return {Ext.data.NodeInterface} this
|
819
|
-
*/
|
820
|
-
remove : function(destroy, suppressEvents) {
|
821
|
-
var parentNode = this.parentNode;
|
822
|
-
|
823
|
-
if (parentNode) {
|
824
|
-
parentNode.removeChild(this, destroy, suppressEvents);
|
825
|
-
}
|
826
|
-
return this;
|
827
|
-
},
|
828
|
-
|
829
|
-
/**
|
830
|
-
* Removes all child nodes from this node.
|
831
|
-
* @param {Boolean} [destroy=false] <True to destroy the node upon removal.
|
832
|
-
* @return {Ext.data.NodeInterface} this
|
833
|
-
*/
|
834
|
-
removeAll : function(destroy, suppressEvents) {
|
835
|
-
var cn = this.childNodes,
|
836
|
-
n;
|
837
|
-
|
838
|
-
while ((n = cn[0])) {
|
839
|
-
this.removeChild(n, destroy, suppressEvents);
|
840
|
-
}
|
841
|
-
return this;
|
842
|
-
},
|
843
|
-
|
844
|
-
/**
|
845
|
-
* Returns the child node at the specified index.
|
846
|
-
* @param {Number} index
|
847
|
-
* @return {Ext.data.NodeInterface}
|
848
|
-
*/
|
849
|
-
getChildAt : function(index) {
|
850
|
-
return this.childNodes[index];
|
851
|
-
},
|
852
|
-
|
853
|
-
/**
|
854
|
-
* Replaces one child node in this node with another.
|
855
|
-
* @param {Ext.data.NodeInterface} newChild The replacement node
|
856
|
-
* @param {Ext.data.NodeInterface} oldChild The node to replace
|
857
|
-
* @return {Ext.data.NodeInterface} The replaced node
|
858
|
-
*/
|
859
|
-
replaceChild : function(newChild, oldChild, suppressEvents) {
|
860
|
-
var s = oldChild ? oldChild.nextSibling : null;
|
861
|
-
|
862
|
-
this.removeChild(oldChild, false, suppressEvents);
|
863
|
-
this.insertBefore(newChild, s, suppressEvents);
|
864
|
-
return oldChild;
|
865
|
-
},
|
866
|
-
|
867
|
-
/**
|
868
|
-
* Returns the index of a child node
|
869
|
-
* @param {Ext.data.NodeInterface} node
|
870
|
-
* @return {Number} The index of the node or -1 if it was not found
|
871
|
-
*/
|
872
|
-
indexOf : function(child) {
|
873
|
-
return Ext.Array.indexOf(this.childNodes, child);
|
874
|
-
},
|
875
|
-
|
876
|
-
/**
|
877
|
-
* Returns the index of a child node that matches the id
|
878
|
-
* @param {String} id The id of the node to find
|
879
|
-
* @return {Number} The index of the node or -1 if it was not found
|
880
|
-
*/
|
881
|
-
indexOfId: function(id) {
|
882
|
-
var childNodes = this.childNodes,
|
883
|
-
len = childNodes.length,
|
884
|
-
i = 0;
|
885
|
-
|
886
|
-
for (; i < len; ++i) {
|
887
|
-
if (childNodes[i].getId() === id) {
|
888
|
-
return i;
|
889
|
-
}
|
890
|
-
}
|
891
|
-
return -1;
|
892
|
-
},
|
893
|
-
|
894
|
-
/**
|
895
|
-
* Gets the hierarchical path from the root of the current node.
|
896
|
-
* @param {String} [field] The field to construct the path from. Defaults to the model idProperty.
|
897
|
-
* @param {String} [separator="/"] A separator to use.
|
898
|
-
* @return {String} The node path
|
899
|
-
*/
|
900
|
-
getPath: function(field, separator) {
|
901
|
-
field = field || this.idProperty;
|
902
|
-
separator = separator || '/';
|
903
|
-
|
904
|
-
var path = [this.get(field)],
|
905
|
-
parent = this.parentNode;
|
906
|
-
|
907
|
-
while (parent) {
|
908
|
-
path.unshift(parent.get(field));
|
909
|
-
parent = parent.parentNode;
|
910
|
-
}
|
911
|
-
return separator + path.join(separator);
|
912
|
-
},
|
913
|
-
|
914
|
-
/**
|
915
|
-
* Returns depth of this node (the root node has a depth of 0)
|
916
|
-
* @return {Number}
|
917
|
-
*/
|
918
|
-
getDepth : function() {
|
919
|
-
return this.get('depth');
|
920
|
-
},
|
921
|
-
|
922
|
-
/**
|
923
|
-
* Bubbles up the tree from this node, calling the specified function with each node. The arguments to the function
|
924
|
-
* will be the args provided or the current node. If the function returns false at any point,
|
925
|
-
* the bubble is stopped.
|
926
|
-
* @param {Function} fn The function to call
|
927
|
-
* @param {Object} [scope] The scope (this reference) in which the function is executed. Defaults to the current Node.
|
928
|
-
* @param {Array} [args] The args to call the function with. Defaults to passing the current Node.
|
929
|
-
*/
|
930
|
-
bubble : function(fn, scope, args) {
|
931
|
-
var p = this;
|
932
|
-
while (p) {
|
933
|
-
if (fn.apply(scope || p, args || [p]) === false) {
|
934
|
-
break;
|
935
|
-
}
|
936
|
-
p = p.parentNode;
|
937
|
-
}
|
938
|
-
},
|
939
|
-
|
940
|
-
//<deprecated since=0.99>
|
941
|
-
cascade: function() {
|
942
|
-
if (Ext.isDefined(Ext.global.console)) {
|
943
|
-
Ext.global.console.warn('Ext.data.Node: cascade has been deprecated. Please use cascadeBy instead.');
|
944
|
-
}
|
945
|
-
return this.cascadeBy.apply(this, arguments);
|
946
|
-
},
|
947
|
-
//</deprecated>
|
948
|
-
|
949
|
-
/**
|
950
|
-
* Cascades down the tree from this node, calling the specified function with each node. The arguments to the function
|
951
|
-
* will be the args provided or the current node. If the function returns false at any point,
|
952
|
-
* the cascade is stopped on that branch.
|
953
|
-
* @param {Function} fn The function to call
|
954
|
-
* @param {Object} [scope] The scope (this reference) in which the function is executed. Defaults to the current Node.
|
955
|
-
* @param {Array} [args] The args to call the function with. Defaults to passing the current Node.
|
956
|
-
*/
|
957
|
-
cascadeBy : function(fn, scope, args) {
|
958
|
-
if (fn.apply(scope || this, args || [this]) !== false) {
|
959
|
-
var childNodes = this.childNodes,
|
960
|
-
length = childNodes.length,
|
961
|
-
i;
|
962
|
-
|
963
|
-
for (i = 0; i < length; i++) {
|
964
|
-
childNodes[i].cascadeBy(fn, scope, args);
|
965
|
-
}
|
966
|
-
}
|
967
|
-
},
|
968
|
-
|
969
|
-
/**
|
970
|
-
* Interates the child nodes of this node, calling the specified function with each node. The arguments to the function
|
971
|
-
* will be the args provided or the current node. If the function returns false at any point,
|
972
|
-
* the iteration stops.
|
973
|
-
* @param {Function} fn The function to call
|
974
|
-
* @param {Object} [scope] The scope (this reference) in which the function is executed. Defaults to the current Node in iteration.
|
975
|
-
* @param {Array} [args] The args to call the function with. Defaults to passing the current Node.
|
976
|
-
*/
|
977
|
-
eachChild : function(fn, scope, args) {
|
978
|
-
var childNodes = this.childNodes,
|
979
|
-
length = childNodes.length,
|
980
|
-
i;
|
981
|
-
|
982
|
-
for (i = 0; i < length; i++) {
|
983
|
-
if (fn.apply(scope || this, args || [childNodes[i]]) === false) {
|
984
|
-
break;
|
985
|
-
}
|
986
|
-
}
|
987
|
-
},
|
988
|
-
|
989
|
-
/**
|
990
|
-
* Finds the first child that has the attribute with the specified value.
|
991
|
-
* @param {String} attribute The attribute name
|
992
|
-
* @param {Object} value The value to search for
|
993
|
-
* @param {Boolean} [deep=false] True to search through nodes deeper than the immediate children
|
994
|
-
* @return {Ext.data.NodeInterface} The found child or null if none was found
|
995
|
-
*/
|
996
|
-
findChild : function(attribute, value, deep) {
|
997
|
-
return this.findChildBy(function() {
|
998
|
-
return this.get(attribute) == value;
|
999
|
-
}, null, deep);
|
1000
|
-
},
|
1001
|
-
|
1002
|
-
/**
|
1003
|
-
* Finds the first child by a custom function. The child matches if the function passed returns true.
|
1004
|
-
* @param {Function} fn A function which must return true if the passed Node is the required Node.
|
1005
|
-
* @param {Object} [scope] The scope (this reference) in which the function is executed. Defaults to the Node being tested.
|
1006
|
-
* @param {Boolean} [deep=false] True to search through nodes deeper than the immediate children
|
1007
|
-
* @return {Ext.data.NodeInterface} The found child or null if none was found
|
1008
|
-
*/
|
1009
|
-
findChildBy : function(fn, scope, deep) {
|
1010
|
-
var cs = this.childNodes,
|
1011
|
-
len = cs.length,
|
1012
|
-
i = 0, n, res;
|
1013
|
-
|
1014
|
-
for (; i < len; i++) {
|
1015
|
-
n = cs[i];
|
1016
|
-
if (fn.call(scope || n, n) === true) {
|
1017
|
-
return n;
|
1018
|
-
}
|
1019
|
-
else if (deep) {
|
1020
|
-
res = n.findChildBy(fn, scope, deep);
|
1021
|
-
if (res !== null) {
|
1022
|
-
return res;
|
1023
|
-
}
|
1024
|
-
}
|
1025
|
-
}
|
1026
|
-
|
1027
|
-
return null;
|
1028
|
-
},
|
1029
|
-
|
1030
|
-
/**
|
1031
|
-
* Returns true if this node is an ancestor (at any point) of the passed node.
|
1032
|
-
* @param {Ext.data.NodeInterface} node
|
1033
|
-
* @return {Boolean}
|
1034
|
-
*/
|
1035
|
-
contains : function(node) {
|
1036
|
-
return node.isAncestor(this);
|
1037
|
-
},
|
1038
|
-
|
1039
|
-
/**
|
1040
|
-
* Returns true if the passed node is an ancestor (at any point) of this node.
|
1041
|
-
* @param {Ext.data.NodeInterface} node
|
1042
|
-
* @return {Boolean}
|
1043
|
-
*/
|
1044
|
-
isAncestor : function(node) {
|
1045
|
-
var p = this.parentNode;
|
1046
|
-
while (p) {
|
1047
|
-
if (p == node) {
|
1048
|
-
return true;
|
1049
|
-
}
|
1050
|
-
p = p.parentNode;
|
1051
|
-
}
|
1052
|
-
return false;
|
1053
|
-
},
|
1054
|
-
|
1055
|
-
/**
|
1056
|
-
* Sorts this nodes children using the supplied sort function.
|
1057
|
-
* @param {Function} fn A function which, when passed two Nodes, returns -1, 0 or 1 depending upon required sort order.
|
1058
|
-
* @param {Boolean} [recursive=false] True to apply this sort recursively
|
1059
|
-
* @param {Boolean} [suppressEvent=false] True to not fire a sort event.
|
1060
|
-
*/
|
1061
|
-
sort : function(sortFn, recursive, suppressEvent) {
|
1062
|
-
var cs = this.childNodes,
|
1063
|
-
ln = cs.length,
|
1064
|
-
i, n;
|
1065
|
-
|
1066
|
-
if (ln > 0) {
|
1067
|
-
Ext.Array.sort(cs, sortFn);
|
1068
|
-
for (i = 0; i < ln; i++) {
|
1069
|
-
n = cs[i];
|
1070
|
-
n.previousSibling = cs[i-1];
|
1071
|
-
n.nextSibling = cs[i+1];
|
1072
|
-
|
1073
|
-
if (i === 0) {
|
1074
|
-
this.setFirstChild(n);
|
1075
|
-
}
|
1076
|
-
if (i == ln - 1) {
|
1077
|
-
this.setLastChild(n);
|
1078
|
-
}
|
1079
|
-
n.updateInfo();
|
1080
|
-
if (recursive && !n.isLeaf()) {
|
1081
|
-
n.sort(sortFn, true, true);
|
1082
|
-
}
|
1083
|
-
}
|
1084
|
-
|
1085
|
-
if (suppressEvent !== true) {
|
1086
|
-
this.fireEvent('sort', this, cs);
|
1087
|
-
}
|
1088
|
-
}
|
1089
|
-
},
|
1090
|
-
|
1091
|
-
/**
|
1092
|
-
* Returns true if this node is expaned
|
1093
|
-
* @return {Boolean}
|
1094
|
-
*/
|
1095
|
-
isExpanded: function() {
|
1096
|
-
return this.get('expanded');
|
1097
|
-
},
|
1098
|
-
|
1099
|
-
/**
|
1100
|
-
* Returns true if this node is loaded
|
1101
|
-
* @return {Boolean}
|
1102
|
-
*/
|
1103
|
-
isLoaded: function() {
|
1104
|
-
return this.get('loaded');
|
1105
|
-
},
|
1106
|
-
|
1107
|
-
/**
|
1108
|
-
* Returns true if this node is loading
|
1109
|
-
* @return {Boolean}
|
1110
|
-
*/
|
1111
|
-
isLoading: function() {
|
1112
|
-
return this.get('loading');
|
1113
|
-
},
|
1114
|
-
|
1115
|
-
/**
|
1116
|
-
* Returns true if this node is the root node
|
1117
|
-
* @return {Boolean}
|
1118
|
-
*/
|
1119
|
-
isRoot: function() {
|
1120
|
-
return !this.parentNode;
|
1121
|
-
},
|
1122
|
-
|
1123
|
-
/**
|
1124
|
-
* Returns true if this node is visible
|
1125
|
-
* @return {Boolean}
|
1126
|
-
*/
|
1127
|
-
isVisible: function() {
|
1128
|
-
var parent = this.parentNode;
|
1129
|
-
while (parent) {
|
1130
|
-
if (!parent.isExpanded()) {
|
1131
|
-
return false;
|
1132
|
-
}
|
1133
|
-
parent = parent.parentNode;
|
1134
|
-
}
|
1135
|
-
return true;
|
1136
|
-
},
|
1137
|
-
|
1138
|
-
/**
|
1139
|
-
* Expand this node.
|
1140
|
-
* @param {Boolean} [recursive=false] True to recursively expand all the children
|
1141
|
-
* @param {Function} [callback] The function to execute once the expand completes
|
1142
|
-
* @param {Object} [scope] The scope to run the callback in
|
1143
|
-
*/
|
1144
|
-
expand: function(recursive, callback, scope) {
|
1145
|
-
var me = this;
|
1146
|
-
|
1147
|
-
// all paths must call the callback (eventually) or things like
|
1148
|
-
// selectPath fail
|
1149
|
-
|
1150
|
-
// First we start by checking if this node is a parent
|
1151
|
-
if (!me.isLeaf()) {
|
1152
|
-
// If it's loaded, wait until it loads before proceeding
|
1153
|
-
if (me.isLoading()) {
|
1154
|
-
me.on('expand', function(){
|
1155
|
-
me.expand(recursive, callback, scope);
|
1156
|
-
}, me, {single: true});
|
1157
|
-
} else {
|
1158
|
-
// Now we check if this record is already expanding or expanded
|
1159
|
-
if (!me.isExpanded()) {
|
1160
|
-
// The TreeStore actually listens for the beforeexpand method and checks
|
1161
|
-
// whether we have to asynchronously load the children from the server
|
1162
|
-
// first. Thats why we pass a callback function to the event that the
|
1163
|
-
// store can call once it has loaded and parsed all the children.
|
1164
|
-
me.fireEvent('beforeexpand', me, function() {
|
1165
|
-
me.set('expanded', true);
|
1166
|
-
if (me.hasListeners.expand) {
|
1167
|
-
me.fireEvent('expand', me, me.childNodes, false);
|
1168
|
-
}
|
1169
|
-
|
1170
|
-
// Call the expandChildren method if recursive was set to true
|
1171
|
-
if (recursive) {
|
1172
|
-
me.expandChildren(true, callback, scope);
|
1173
|
-
} else {
|
1174
|
-
Ext.callback(callback, scope || me, [me.childNodes]);
|
1175
|
-
}
|
1176
|
-
}, me);
|
1177
|
-
} else if (recursive) {
|
1178
|
-
// If it is is already expanded but we want to recursively expand then call expandChildren
|
1179
|
-
me.expandChildren(true, callback, scope);
|
1180
|
-
} else {
|
1181
|
-
Ext.callback(callback, scope || me, [me.childNodes]);
|
1182
|
-
}
|
1183
|
-
}
|
1184
|
-
} else {
|
1185
|
-
// If it's not then we fire the callback right away
|
1186
|
-
Ext.callback(callback, scope || me); // leaf = no childNodes
|
1187
|
-
}
|
1188
|
-
},
|
1189
|
-
|
1190
|
-
/**
|
1191
|
-
* Expand all the children of this node.
|
1192
|
-
* @param {Boolean} [recursive=false] True to recursively expand all the children
|
1193
|
-
* @param {Function} [callback] The function to execute once all the children are expanded
|
1194
|
-
* @param {Object} [scope] The scope to run the callback in
|
1195
|
-
*/
|
1196
|
-
expandChildren: function(recursive, callback, scope) {
|
1197
|
-
var me = this,
|
1198
|
-
i = 0,
|
1199
|
-
nodes = me.childNodes,
|
1200
|
-
ln = nodes.length,
|
1201
|
-
node,
|
1202
|
-
expanding = 0;
|
1203
|
-
|
1204
|
-
for (; i < ln; ++i) {
|
1205
|
-
node = nodes[i];
|
1206
|
-
if (!node.isLeaf() && !node.isExpanded()) {
|
1207
|
-
expanding++;
|
1208
|
-
nodes[i].expand(recursive, function () {
|
1209
|
-
expanding--;
|
1210
|
-
if (callback && !expanding) {
|
1211
|
-
Ext.callback(callback, scope || me, [me.childNodes]);
|
1212
|
-
}
|
1213
|
-
});
|
1214
|
-
}
|
1215
|
-
}
|
1216
|
-
|
1217
|
-
if (!expanding && callback) {
|
1218
|
-
Ext.callback(callback, scope || me, [me.childNodes]); }
|
1219
|
-
},
|
1220
|
-
|
1221
|
-
/**
|
1222
|
-
* Collapse this node.
|
1223
|
-
* @param {Boolean} [recursive=false] True to recursively collapse all the children
|
1224
|
-
* @param {Function} [callback] The function to execute once the collapse completes
|
1225
|
-
* @param {Object} [scope] The scope to run the callback in
|
1226
|
-
*/
|
1227
|
-
collapse: function(recursive, callback, scope) {
|
1228
|
-
var me = this;
|
1229
|
-
|
1230
|
-
// First we start by checking if this node is a parent
|
1231
|
-
if (!me.isLeaf()) {
|
1232
|
-
// Now we check if this record is already collapsing or collapsed
|
1233
|
-
if (!me.collapsing && me.isExpanded()) {
|
1234
|
-
me.fireEvent('beforecollapse', me, function() {
|
1235
|
-
me.set('expanded', false);
|
1236
|
-
if (me.hasListeners.collapse) {
|
1237
|
-
me.fireEvent('collapse', me, me.childNodes, false);
|
1238
|
-
}
|
1239
|
-
|
1240
|
-
// Call the collapseChildren method if recursive was set to true
|
1241
|
-
if (recursive) {
|
1242
|
-
me.collapseChildren(true, callback, scope);
|
1243
|
-
}
|
1244
|
-
else {
|
1245
|
-
Ext.callback(callback, scope || me, [me.childNodes]);
|
1246
|
-
}
|
1247
|
-
}, me);
|
1248
|
-
}
|
1249
|
-
// If it is is already collapsed but we want to recursively collapse then call collapseChildren
|
1250
|
-
else if (recursive) {
|
1251
|
-
me.collapseChildren(true, callback, scope);
|
1252
|
-
}
|
1253
|
-
}
|
1254
|
-
// If it's not then we fire the callback right away
|
1255
|
-
else {
|
1256
|
-
Ext.callback(callback, scope || me, [me.childNodes]);
|
1257
|
-
}
|
1258
|
-
},
|
1259
|
-
|
1260
|
-
/**
|
1261
|
-
* Collapse all the children of this node.
|
1262
|
-
* @param {Function} [recursive=false] True to recursively collapse all the children
|
1263
|
-
* @param {Function} [callback] The function to execute once all the children are collapsed
|
1264
|
-
* @param {Object} [scope] The scope to run the callback in
|
1265
|
-
*/
|
1266
|
-
collapseChildren: function(recursive, callback, scope) {
|
1267
|
-
var me = this,
|
1268
|
-
i = 0,
|
1269
|
-
nodes = me.childNodes,
|
1270
|
-
ln = nodes.length,
|
1271
|
-
node,
|
1272
|
-
collapsing = 0;
|
1273
|
-
|
1274
|
-
for (; i < ln; ++i) {
|
1275
|
-
node = nodes[i];
|
1276
|
-
if (!node.isLeaf() && node.isExpanded()) {
|
1277
|
-
collapsing++;
|
1278
|
-
nodes[i].collapse(recursive, function () {
|
1279
|
-
collapsing--;
|
1280
|
-
if (callback && !collapsing) {
|
1281
|
-
Ext.callback(callback, scope || me, [me.childNodes]);
|
1282
|
-
}
|
1283
|
-
});
|
1284
|
-
}
|
1285
|
-
}
|
1286
|
-
|
1287
|
-
if (!collapsing && callback) {
|
1288
|
-
Ext.callback(callback, scope || me, [me.childNodes]);
|
1289
|
-
}
|
1290
|
-
}
|
1291
|
-
};
|
1292
|
-
}
|
1293
|
-
}
|
1294
|
-
});
|