Editor sometines isn't populating SELECT fields
Editor sometines isn't populating SELECT fields
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
This discussion has been closed.
Answers
Are you able to give me a link to the page so I can debug it live please?
Allan
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
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
Of course,
that's the tricky bit :)
LINK 1: http://pasteboard.co/1K6ujICO.png
LINK 2: http://pasteboard.co/1K6xgrQn.png
Thanks,
Jakub
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 usingdependent()
(possibly some kind of callback / Promises mechanism).Sorry I don't have a better answer for you at the moment.
Allan
Thanks Alan,
I used it on every ajax call but the issue still exists...
Did I make something wrong?
Thanks,
Jakub