Results 1 to 6 of 6

Thread: How to update a store?

  1. #1
    Sencha User
    Join Date
    Mar 2012
    Posts
    47
    Answers
    3
    Vote Rating
    0
      0  

    Default Answered: How to update a store?

    HI,

    I want update a store using my form but i don't know what function do i have to use.

    Code:
    var offlineStore = Ext.getStore('ProspectsOffline');
    var r = offlineStore.findRecord('id',this.getFiche().getValues().id); 
    ????
    offlineStore.sync();
    Using my code i'm able to find the record that i want to updated in my store.
    Please need help.

  2. Hi,
    do you mean that you want to update the record you've found?
    If so, you just need to call

    Code:
    r.set('<YOUR_FIELD_NAME>','<YOUR_VALUE>');
    If this is not what you are trying to achieve, could you please provide more informations?

    Hope this helps.

  3. #2
    Sencha - Services Team AndreaCammarata's Avatar
    Join Date
    Jun 2009
    Location
    Italy
    Posts
    1,395
    Answers
    148
    Vote Rating
    24
      0  

    Default

    Hi,
    do you mean that you want to update the record you've found?
    If so, you just need to call

    Code:
    r.set('<YOUR_FIELD_NAME>','<YOUR_VALUE>');
    If this is not what you are trying to achieve, could you please provide more informations?

    Hope this helps.
    Sencha Inc
    Andrea Cammarata, Solutions Engineer
    Owner at SIMACS

    @AndreaCammarata
    www.andreacammarata.com
    github: https://github.com/AndreaCammarata

    TUX components bundle for Sencha Touch 2.x.x
    https://github.com/AndreaCammarata/TUX


  4. #3
    Sencha User
    Join Date
    Mar 2012
    Posts
    47
    Answers
    3
    Vote Rating
    0
      0  

    Default

    Quote Originally Posted by AndreaCammarata View Post
    Hi,
    do you mean that you want to update the record you've found?
    If so, you just need to call

    Code:
    r.set('<YOUR_FIELD_NAME>','<YOUR_VALUE'>);
    If this is not what you are trying to achieve, could you please provide more informations?

    Hope this helps.
    Yes, that's exactly what i'm trying to do. THanks.

    Do i have to use store.sync() after r.set() ???

  5. #4
    Sencha - Services Team AndreaCammarata's Avatar
    Join Date
    Jun 2009
    Location
    Italy
    Posts
    1,395
    Answers
    148
    Vote Rating
    24
      0  

    Default

    If the proxy has been set on your store yes, otherwise, if is set on your model you can call the model "save()" function.
    Sencha Inc
    Andrea Cammarata, Solutions Engineer
    Owner at SIMACS

    @AndreaCammarata
    www.andreacammarata.com
    github: https://github.com/AndreaCammarata

    TUX components bundle for Sencha Touch 2.x.x
    https://github.com/AndreaCammarata/TUX


  6. #5
    Sencha User
    Join Date
    Mar 2012
    Posts
    47
    Answers
    3
    Vote Rating
    0
      0  

    Default

    Quote Originally Posted by AndreaCammarata View Post
    If the proxy has been set on your store yes, otherwise, if is set on your model you can call the model "save()" function.
    Thank you vey much for your help i used sync and it works now.

  7. #6
    Sencha - Services Team AndreaCammarata's Avatar
    Join Date
    Jun 2009
    Location
    Italy
    Posts
    1,395
    Answers
    148
    Vote Rating
    24
      0  

    Default

    Quote Originally Posted by romulus2012 View Post
    Thank you vey much for your help i used sync and it works now.
    Glad it helped you
    Sencha Inc
    Andrea Cammarata, Solutions Engineer
    Owner at SIMACS

    @AndreaCammarata
    www.andreacammarata.com
    github: https://github.com/AndreaCammarata

    TUX components bundle for Sencha Touch 2.x.x
    https://github.com/AndreaCammarata/TUX


Posting Permissions

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