Results 1 to 8 of 8

Thread: Declarative Views: Any Plans In ExtJS 6.x?

  1. #1
    Sencha User
    Join Date
    Jul 2009
    Posts
    69
    Answers
    1

    Default Answered: Declarative Views: Any Plans In ExtJS 6.x?

    In SenchaCon last year declarative views was demoed in FastBook implementation and was anticipated to arrive sometime in 5.x release. http://www.sencha.com/forum/showthre...tive-xml-views

    Are there any plans to bring it in going forward in 6.x releases?

  2. Many of the concepts demoed by Jacky have been incorporated in Ext JS 5... except for the XML-based syntax. As Nige mentioned, we have a very declarative view approach (albeit JSON format) in v5+.

    We are still considering XML-based views but more in the light of web components instead of a different syntax.

  3. #2
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,892
    Answers
    41

    Default

    Views may be defined in declarative JSON in Sencha 6.x

    XML is just another representation of the same information which needs to be converted into a Javascript structure anyway.

  4. #3
    Sencha User dongryphon's Avatar
    Join Date
    Jul 2009
    Location
    Kansas
    Posts
    1,748
    Answers
    55

    Default

    Many of the concepts demoed by Jacky have been incorporated in Ext JS 5... except for the XML-based syntax. As Nige mentioned, we have a very declarative view approach (albeit JSON format) in v5+.

    We are still considering XML-based views but more in the light of web components instead of a different syntax.
    Don Griffin

    "Use the source, Luke!"

  5. #4
    Sencha User
    Join Date
    Jul 2009
    Posts
    69
    Answers
    1

    Default

    Thanks @Animal and @dongryphon, JSON is fine for views as long as it is JSON5 compatible for example it allows comments. Going towards web component style approach makes a lot of sense. Looking forward to a fantastic release of ExtJS6.

  6. #5
    Sencha User dongryphon's Avatar
    Join Date
    Jul 2009
    Location
    Kansas
    Posts
    1,748
    Answers
    55

    Default

    Thanks for the kind words.

    I should probably clarify since you mentioned JSON5. A view in Ext JS 5 is declarative like this one:

    http://dev.sencha.com/extjs/5.1.0/ex...inding-two-way

    Code:
    Ext.define('KitchenSink.view.binding.TwoWay', {
        extend: 'Ext.panel.Panel',
        alias: 'widget.binding-two-way',
    
        width: 300,
        bodyPadding: 10,
    
        viewModel: {
            data: {
                title: 'The title'
            }
        },
    
        bind: {
            title: '{title}'
        },
    
        items: {
            xtype: 'textfield',
            fieldLabel: 'Title',
            labelWidth: 50,
            // The default config for textfield in a bind is "value" (two-way):
            bind: '{title}'
        }
    });
    Notice there is no logic in this view. Just the Ext.define call to declare it. The body of the class could have come from a JSON5 file. Hooking up controllers and ViewModel-derived classes would likewise be declarative:

    Code:
        controller: 'foo',  // matches the 'controller.foo' alias
    
        viewModel: {
            type: 'foo',  // matches the 'viewmodel.foo' alias
            data: {
                title: 'The title'
            }
        },
    Hope that clears that terminology up.
    Don Griffin

    "Use the source, Luke!"

  7. #6
    Sencha User
    Join Date
    Jul 2009
    Posts
    69
    Answers
    1

    Default

    @dongryphon you are awesome. I can clearly see that now. The example you picked was sharp and to-the-point. I was able to quickly transform (in my mind) the object/body of the code into the equivalent XML syntax with children nodes and dot-separated nested properties as illustrated in the SenchaCon last year. Thanks!

  8. #7
    Sencha Premium Member
    Join Date
    Apr 2011
    Location
    Chicago, IL
    Posts
    83
    Answers
    3

    Default

    I'm excited to hear that the WebComponents standard is on the radar. Just out of curiosity, though, wouldn't a benefit of an XML format be that you could provide a schema definition, and then any IDE or arbitrary XML editor would get IntelliSense-like autocomplete and static validation of the view configuration?
    Chad Glendenin

  9. #8
    Sencha User dongryphon's Avatar
    Join Date
    Jul 2009
    Location
    Kansas
    Posts
    1,748
    Answers
    55

    Default

    XML Schema is definitely one benefit - we'll have to see how all that works out in the world of web components (certainly it will be one of the benefits). If you heard about the IDE plugins we are working on, I think you'll see a lot of that kind of thing taking shape in pure JavaScript soon (starting with Jet Brains IDE's).
    Don Griffin

    "Use the source, Luke!"

Similar Threads

  1. Declarative Views & Item Templating
    By Carun in forum Ext 5: Q&A
    Replies: 2
    Last Post: 11 Apr 2014, 8:04 AM
  2. Declarative xml views
    By firefoxSafari in forum Ext 5: Q&A
    Replies: 3
    Last Post: 4 Apr 2014, 6:30 PM
  3. [Ext declarative] Is there any way...
    By thekryz in forum Ext 2.x: Help & Discussion
    Replies: 5
    Last Post: 18 Mar 2008, 1:27 PM
  4. [FIXED] Declarative Updater's listener
    By XASD in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 18 Feb 2008, 6:26 AM
  5. Declarative Ext vs Iterative Ext
    By philmaker in forum Ext 2.x: Help & Discussion
    Replies: 11
    Last Post: 16 Oct 2007, 7:34 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •