Results 1 to 2 of 2

Thread: view model and form fields loading issue

  1. #1
    Sencha User
    Join Date
    Dec 2015
    Posts
    117
    Answers
    12

    Default Answered: view model and form fields loading issue

    Hello,

    I am having an issue where when I call setData on the view model, the ui is updated correctly.
    But then if I load a second time without touching/interacting with the form all the fields are empty, even though the view model has the value set.

    I tried to reproduce the issue on sencha fiddle, but I was unable to fully do it but it seems like there is a similar issue happening.

    Here is the fiddle

    If we start the fiddle then click on load, the combobox will remain blank.
    Now if we change the choice to something, then click on load the combobox is set correctly.

    Do you know what is going on?
    Also, how can I make components load/refresh the bound value?

    Thank you,

  2. Hi,

    The problem here is that proxy which we have defined is making it wait and not loading it immediately. That's the reason why it works fine if we add autoLoad: true config.

    What we can do is take the data out of the proxy so that it is loaded.

    store: {
    // autoLoad: true,
    proxy: {
    type: 'memory',
    },
    data: [
    { Text: 'Sel1', Value: 1 },
    { Text: 'Sel2', Value: 2 },
    { Text: 'Sel3', Value: 3 }
    ]
    }

    ​Thanks!

  3. #2
    Ext Support Team
    Join Date
    Nov 2017
    Posts
    46
    Answers
    2

    Default

    Hi,

    The problem here is that proxy which we have defined is making it wait and not loading it immediately. That's the reason why it works fine if we add autoLoad: true config.

    What we can do is take the data out of the proxy so that it is loaded.

    store: {
    // autoLoad: true,
    proxy: {
    type: 'memory',
    },
    data: [
    { Text: 'Sel1', Value: 1 },
    { Text: 'Sel2', Value: 2 },
    { Text: 'Sel3', Value: 3 }
    ]
    }

    ​Thanks!

Similar Threads

  1. Replies: 5
    Last Post: 26 Apr 2016, 3:37 PM
  2. Replies: 2
    Last Post: 14 Apr 2016, 9:15 PM
  3. Dynamic store field, model prototype issue with dot chars
    By dilyanbg in forum Ext: Discussion
    Replies: 3
    Last Post: 5 Feb 2015, 4:09 PM
  4. Dynamically loading a view & model
    By brzi in forum Ext 5: Q&A
    Replies: 2
    Last Post: 17 Apr 2014, 12:00 AM
  5. Model Fields and Form Fields - I'm a lazy typist
    By twittopher in forum Ext: Discussion
    Replies: 6
    Last Post: 19 May 2011, 7:15 AM

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
  •