Results 1 to 2 of 2

Thread: Trying to understand HttpProxy api

  1. #1

    Question Trying to understand HttpProxy api

    Hi all,

    I am busy learning Ext JS for a few weeks now and I understand most of it after a little practice.
    One thing that still puzzles me is the api for the HttpProxy. I've read the documentation and have searched for examples. But no luck. My mind is still confused about it.

    Code:
      
    var proxy = new Ext.data.HttpProxy({
        api: {
            read : 'view.php,
            create : 'create.php',
            update: 'update.php',
            destroy: 'destroy.php'
        }
    });
    I understand how I can connect this proxy to a datastore. The thing I don't understand is how the proxy knows which api to use. Is this done automatically? Or do I need to fire an event of some sort?

    I would appriciate a little more insight in the concept of this. It looks like a option to make (coding) life a little easier.

    thanks,
    Ton

  2. #2
    Sencha Premium Member steffenk's Avatar
    Join Date
    Jul 2007
    Location
    Haan, Germany
    Posts
    2,675

    Default

    Hi,

    the Api object is something different, the following description from the docs makes it clear:
    Ext.data.Api is a singleton designed to manage the data API including methods for validating a developer's DataProxy API. Defines variables for CRUD actions create, read, update and destroy in addition to a mapping of RESTful HTTP methods GET, POST, PUT and DELETE to CRUD actions.
    The proxy is nothing more than a wrapper for handling data processes. You can define it once and use it in many objects.
    vg Steffen
    --------------------------------------
    Release Manager of TYPO3 4.5

Posting Permissions

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