Results 1 to 3 of 3

Thread: Ext.container.Container or Ext.view.View: Which to Use?

  1. #1
    Sencha Premium Member
    Join Date
    Apr 2015
    Posts
    15

    Default Ext.container.Container or Ext.view.View: Which to Use?

    My team is new to ExtJS 5. We are constructing an application that will iterate through and display a number of Trip objects such as the image below so that drivers can select which trip they would like to drive. Details such as date, miles, and stops will be queried from a database and used to create each trip instance depending on some user input filter criteria.

    All of this is one trip object.
    Trip Instance.PNG

    We are debating the merits of a container vs. a view for displaying a list of, say, 50 trips. We are interested in using data binding. View seem to be the way to go because Views are data-backed components according to Sencha's documentation, and thus intended for showing data driven objects. However, it seems that Container can also support data binding (although I have not yet found that explicitly stated). Currently we are able to generate multiple Trip objects in a container using an MVC approach, but want to switch to MVVM if appropriate. There will be changes on the fly to the data underlying a trip and it would be nice to instantly reflect that in a trip object.

    Thoughts on when to use View and when to use Container would be appreciated. Thanks!

  2. #2
    Sencha Premium Member Tarabass's Avatar
    Join Date
    Jun 2010
    Location
    The Netherlands
    Posts
    51

    Default

    What we do at our team is looking at the 'lowest' and 'smallest' object that fits our needs. For example, if we need keyboard and mouse navigation we would go for the view. If we don't we would go for the container. As an example though, I didn't look in to it.

    In a touch app we could go for a listview, but we have chosen to use the dataview. The main differences between those are styling, and we wanted to style our view in such way that we would override almost anything in a listview. So we styled our dataview, which was the best option for us.

    What we keep in mind also is overnesting. Yes, we could use a panel and put a form into the item array. But we could also directly extend from form. In that case we would choose form over panel..

  3. #3
    Sencha User
    Join Date
    Jun 2008
    Posts
    242
    Answers
    22

    Default

    Im gonna say View based on your photo since your layout looks like it will be static per item. For example, Table doesn't use containers for the rows - it uses View. View will pull records from a store and when you change those records the view will update.

Similar Threads

  1. Can't Add View to a Container
    By MrPoofy in forum Sencha Touch 2.x: Q&A
    Replies: 2
    Last Post: 23 Oct 2013, 12:49 AM
  2. Container -> View autoscrolling
    By norbul in forum Ext: Q&A
    Replies: 1
    Last Post: 14 Jun 2013, 8:04 PM
  3. Why won't a list render in my container in my view?
    By mririgo in forum Sencha Touch 2.x: Q&A
    Replies: 2
    Last Post: 8 Jun 2012, 12:57 PM
  4. Adding a container to every view of a navagation view
    By tmcdonald in forum Sencha Touch 2.x: Q&A
    Replies: 2
    Last Post: 14 May 2012, 11:55 AM
  5. Replies: 2
    Last Post: 26 Apr 2012, 4:57 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
  •