1. #1
    Sencha User masoud_tamizy's Avatar
    Join Date
    Oct 2011
    Posts
    108
    Answers
    1
    Vote Rating
    0
    masoud_tamizy is on a distinguished road

      0  

    Default Unanswered: how work CRUD or how can i use CRUD ?

    Unanswered: how work CRUD or how can i use CRUD ?


    do you know how can i do CRUD as simple way with ajax ?
    my code is in following post :
    http://www.sencha.com/forum/showthread.php?175208-I-encounterde-this-error-on-loading-data-from-server-to-a-grid
    but with some changes (will mention below):
    api:{
    read : 'prepare.php',
    delete : 'delete.php'
    }

    but i don't know how can i do for delete or update operations !!!

    what method or property have to be setted to it work ???
    Last edited by masoud_tamizy; 22 Jan 2012 at 8:42 PM. Reason: completting question

  2. #2
    Sencha User chramer's Avatar
    Join Date
    Feb 2011
    Location
    Chisinau, Moldova
    Posts
    203
    Answers
    42
    Vote Rating
    10
    chramer will become famous soon enough

      0  

  3. #3
    Sencha User masoud_tamizy's Avatar
    Join Date
    Oct 2011
    Posts
    108
    Answers
    1
    Vote Rating
    0
    masoud_tamizy is on a distinguished road

      0  

    Default


    Quote Originally Posted by chramer View Post
    thanks , but i didn't understand how it work , i.e what happened for e.g update operation and what method lead to do it ?

  4. #4
    Sencha User chramer's Avatar
    Join Date
    Feb 2011
    Location
    Chisinau, Moldova
    Posts
    203
    Answers
    42
    Vote Rating
    10
    chramer will become famous soon enough

      0  

    Default


    Let's say you have a grid! And you perform some changes (inserts/update/delete).
    The grid has a store, the store has a proxy.
    So.. the changes that you've made in the grid, you want to send them to the server.

    For that you use the "sync" method :
    PHP Code:
        grid.getStore().sync(); 
    The sync method will determine what data will be sent and where (depending of your "api" config) it will be sent!
    Was I clear ?

  5. #5
    Sencha Premium Member lorezyra's Avatar
    Join Date
    Dec 2007
    Location
    Japan -- 日本
    Posts
    636
    Answers
    9
    Vote Rating
    15
    lorezyra will become famous soon enough lorezyra will become famous soon enough

      0  

    Default


    Perhaps you should spend a little time in the LEARN section of this site...

    http://www.sencha.com/learn/the-data-package/

    http://www.sencha.com/learn/the-grid-component/

    It would also help greatly if you were to pick up the book "ExtJS in Action" by Jessie Garcia. Even though it's for ExtJS 3.x, the techniques for applying CRUD/REST-based stores and grids still work well for ExtJS 4. I heard that Jessie is working on updating his book to cover version 4. I find myself referencing it from time to time.
    Perfection as a goal is a nice idea that can point one in a specific direction. However, since "perfection" is an ever changing (evolving?) and moving target, one must admit that perfection can never be obtained...

    When in doubt, check the d4mn source code!
    ================================================
    And here are my terms...
    1. I don't care if you use my source code. (Known as "Code.")
    2. I don't care if I get any monetary compensation.
    3. I do care to receive credit for Code provided. So, please keep my name in the comments for Code provided.
    4. Code is provided without warranty "AS-IS" and I claim absolutely no warranty nor liability to the quality, security, and run-ability on any platform.
    5. By using Code, you accept all risk inherit with Code regardless if Code has known and yet to be discovered bugs.
    6. You are welcome to change and improve the Code to best meet your needs.
    7. I don't care if you use the Code in a commercial or open-source project.
    8. You are not required to contact me prior to using the Code.
    ================================================
    Simple. Enjoy.

Thread Participants: 2