Results 1 to 3 of 3

Thread: Model which loads a single record via its proxy

  1. #1
    Sencha User
    Join Date
    Jun 2012
    Posts
    37
    Answers
    3
    Vote Rating
    4
      0  

    Default Unanswered: Model which loads a single record via its proxy

    In the examples when loading data via a models proxy. You call load and pass a id. load(10)
    http://docs.sencha.com/touch/2-0/#!/...ic-method-load

    This id is then passed as a parameter on the request

    I however just want to load a single request from a server.
    The server does now not require or support the id parameter.

    So I would just like to call load()

  2. #2
    Sencha User jerome76's Avatar
    Join Date
    Apr 2012
    Location
    New Jersey
    Posts
    1,149
    Answers
    132
    Vote Rating
    100
      0  

    Default

    You can try overriding the load function, or use a separate proxy and set the Model data in the response, or using a Store and its load function.

    The id parameter in the function is just to give your Model a unique id, rather than having one automatically generated.

  3. #3
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,326
    Answers
    3884
    Vote Rating
    1297
      0  

    Default

    Just use an Ajax request and in callback of it create the Model instance.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

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
  •