1. #1
    Ext JS Premium Member
    Join Date
    Apr 2011
    Location
    Dallas, TX
    Posts
    204
    Vote Rating
    1
    Justin Noel is on a distinguished road

      0  

    Default Ext MVC CRUD Demo

    Ext MVC CRUD Demo


    I just started with Ext recently and had a horrible time trying to figure it out. I've posted (complained - lol) several times about the lack of a real demo that shows CRUD in the MVC architecture.

    Finally, I have put together a small sample myself.

    Ext 4.X MVC CRUD Demo

    I hope it does the following:
    • Gets some input from others about all the things that are wrong in it!
    • Helps others start with Ext.

    If you have feedback on it, please be constructive. Again, this is my first real stab at Ext.

    NOTES :
    You need PHP to run this sample. Why? Because I used PHP for the server side and sessions to maintain customer lists while playing.

    The "Vendor" section of this does very little. I just built out CRUD for the Customer section. The vendor section is just to show what multiple tabs would look like in the Center region.

  2. #2
    Sencha User
    Join Date
    Apr 2011
    Posts
    32
    Vote Rating
    0
    Bunneh is on a distinguished road

      0  

    Default


    Thanks, and finally we have something 'real'! Hope you will fix and develop this sample to use more and more widgets and other Ext capabilities further.

  3. #3
    Sencha User
    Join Date
    May 2011
    Posts
    11
    Vote Rating
    0
    klb is on a distinguished road

      0  

    Default


    Thank you! It is nice to see something that actually works.

  4. #4
    Sencha - Community Support Team edspencer's Avatar
    Join Date
    Jan 2009
    Location
    Palo Alto, California
    Posts
    1,939
    Vote Rating
    7
    edspencer is a jewel in the rough edspencer is a jewel in the rough edspencer is a jewel in the rough

      0  

    Default


    Very nice

    Btw I totally hear you on the insufficient examples and docs for the MVC architecture. We're working very hard on that right now
    Ext JS Senior Software Architect
    Personal Blog: http://edspencer.net
    Twitter: http://twitter.com/edspencer
    Github: http://github.com/edspencer

  5. #5
    Sencha User
    Join Date
    Jun 2011
    Posts
    5
    Vote Rating
    0
    mam is on a distinguished road

      0  

    Default


    It would be great if one of the official MVC demos were a port of the "TKE" sample app from Chapter 16 of Jesus' "ExtJS In Action" book.

    It's large enough to be non-trivial, but not too large. This would also be a great way to contrast the new 4.0 MVC patterns/idioms/api with the well documented 3.0 implementation from the book.

    Any samples you build should also explain the design choices and the differences from 3.0.

    Thanks.

  6. #6
    Sencha Premium Member
    Join Date
    Dec 2010
    Location
    Auckland, NZ
    Posts
    56
    Vote Rating
    13
    superstructor will become famous soon enough

      0  

    Default


    Thanks for posting the example Justin.

    Duplicating models for each CRUD operation doesn't really seam like the best way though ? Is that really Sencha's suggested best practice Ed ? Its certainly not DRY (aka duplication is evil) and if it is the suggested practice indicates a flaw in the Ext4 data architecture.

    Any thoughts ?

  7. #7
    Sencha - Community Support Team edspencer's Avatar
    Join Date
    Jan 2009
    Location
    Palo Alto, California
    Posts
    1,939
    Vote Rating
    7
    edspencer is a jewel in the rough edspencer is a jewel in the rough edspencer is a jewel in the rough

      0  

    Default


    When you say duplicating Models for each operation I'm not really sure what you mean...
    Ext JS Senior Software Architect
    Personal Blog: http://edspencer.net
    Twitter: http://twitter.com/edspencer
    Github: http://github.com/edspencer

  8. #8
    Sencha Premium Member
    Join Date
    Dec 2010
    Location
    Auckland, NZ
    Posts
    56
    Vote Rating
    13
    superstructor will become famous soon enough

      0  

    Default


    Thanks for the reply Ed, sorry I wasn't too clear.

    In the posted example the following files all define a customer model for add, edit and list:

    https://github.com/calendee/Ext-JS-4...merAddModel.js
    https://github.com/calendee/Ext-JS-4...erEditModel.js
    https://github.com/calendee/Ext-JS-4...erListModel.js

    The only major differences are that the edit model has some extra fields, and the attached proxies all use different URLs.

    It looks like with a REST proxy (Ext.data.proxy.Rest) it should be possible to use the same resource URL for add/edit/delete/get and list. I.e. use of the HTTP verbs GET, POST, PUT, DELETE.

    With optional fields (e.g. for add vs edit) and view configurations (e.g. only showing some of the model's fields in a grid with Ext.data.Panel columns config) and so forth it should be completely fine to share the model between all the CRUD operations ?

    Is there a good reason to separate models into AddModel, EditModel, ListModel etc? Just to me it seams you would end up duplicating field definitions and possibly validations etc.

    Look forward to reading your thoughts on this.

    Cheers.

  9. #9
    Sencha - Community Support Team edspencer's Avatar
    Join Date
    Jan 2009
    Location
    Palo Alto, California
    Posts
    1,939
    Vote Rating
    7
    edspencer is a jewel in the rough edspencer is a jewel in the rough edspencer is a jewel in the rough

      0  

    Default


    Ah I see - hadn't noticed that. Yes you're right, these should all be the same Model - the Proxy is there to handle all of the persistence
    Ext JS Senior Software Architect
    Personal Blog: http://edspencer.net
    Twitter: http://twitter.com/edspencer
    Github: http://github.com/edspencer

  10. #10
    Ext JS Premium Member
    Join Date
    Apr 2011
    Location
    Dallas, TX
    Posts
    204
    Vote Rating
    1
    Justin Noel is on a distinguished road

      0  

    Default


    Is that really Sencha's suggested best practice Ed ?
    Thanks for the input. This is certainly not an example of Sencha's best practices. This is simply my first stab at an MVC example with Ext. It's my first Ext JS application ever. I put this out there because I could not find a decent example to learn from. So, I'm hoping input such as yours will help myself and others to learn.

    With optional fields (e.g. for add vs edit) and view configurations (e.g. only showing some of the model's fields in a grid with Ext.data.Panel columns config) and so forth it should be completely fine to share the model between all the CRUD operations ?
    I actually considered doing exactly that initially. However, keep in mind this is a somewhat simplified example. The Grid Panel is simply there to be a list of customers. Imagine there are 50, 100, or 250 in the list. How much sense does it make to transmit the address details for 500 customers just to populate the list JUST IN CASE one of them is clicked on to have their details viewed/edited?

    With a more complex example, the edit customer tab would not be the only result of clicking on a customer. You might have a tab to see their orders, see their trouble tickets, etc. Surely you don't want a single model that loads all that info at once just to avoid having a model, controller, and store for Orders, TroubleTickets, SubscriptionPreferences, etc.

    Please advise.

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar