Editor sometines isn't populating SELECT fields

Editor sometines isn't populating SELECT fields

helpdeskhelpdesk Posts: 20Questions: 3Answers: 0

The error is quite strange for me, as auto populating select fields on editing sometimes work, sometimes simply not. Then once Edit Box is closed and re-opened again proper edit values appears in the select dropdowns.

Does anyone have any idea how to check what's wrong? I know that editor.dependant function is returning all necessary data to mach existing records.

Thanks,
Jakub

Code sample here: https://codeshare.io/N5por

Answers

  • allanallan Posts: 61,821Questions: 1Answers: 10,127 Site admin

    Are you able to give me a link to the page so I can debug it live please?

    Allan

  • helpdeskhelpdesk Posts: 20Questions: 3Answers: 0
    edited February 2016

    Sure, and thank you.

    Don't worry about cert error - it's a dev server.

    https://dev.gs-fresh.com/growing/

    edited - allan Retracted u/p

  • allanallan Posts: 61,821Questions: 1Answers: 10,127 Site admin

    Thanks for the link. Could you walk me through how to reproduce the error please? What rows to select and what field's don't work for example. I wasn't able to reproduce the issue just now (at least, not that I noticed!).

    Allan

  • helpdeskhelpdesk Posts: 20Questions: 3Answers: 0
    edited February 2016

    Of course,
    that's the tricky bit :)

    1. I pick any record and then hit Edit
    2. On the first LINK you can see that Variety and Field Name fields are not populated.
    3. When I closed edit window and Click Edit again they have been populated properly (LINK 2)
    4. This is happening randomly, you can pick 4 records that will work and next time they wont :)

    LINK 1: http://pasteboard.co/1K6ujICO.png
    LINK 2: http://pasteboard.co/1K6xgrQn.png

    Thanks,
    Jakub

  • allanallan Posts: 61,821Questions: 1Answers: 10,127 Site admin

    Thanks for the clarification! This is a timing issue due to the Ajax dependent() calls. There are currently 11 Ajax calls when I hit the edit option due to those calls.

    In many cases the data is returned quickly enough not to be an issue, but as always with async code you are going to run into some cases where that isn't the case.

    At the moment my best suggestion is to use async: false in your Ajax calls to stop the timing issue. That of course is a terrible solution but I think its the only one available at the moment until I implement something in Editor that will allow this to be addressed when using dependent() (possibly some kind of callback / Promises mechanism).

    Sorry I don't have a better answer for you at the moment.

    Allan

  • helpdeskhelpdesk Posts: 20Questions: 3Answers: 0
    edited February 2016

    Thanks Alan,
    I used it on every ajax call but the issue still exists...

    Did I make something wrong?

    Thanks,
    Jakub

This discussion has been closed.