standalone inline editor only working on first edit for date, selectize, select2 and chosen fields

standalone inline editor only working on first edit for date, selectize, select2 and chosen fields

wouterwouter Posts: 22Questions: 7Answers: 0

He everyone!

I think i might be running into a bug in the stand-alone inline editor. I have two problems that look like they're caused by the same problem but might also be two different things going on.

First thing is with the date field. When I enter the field, i get the popup for selecting the date. When i then save and open the field for the second time, the popup is no longer showing.

the second problem is with the chosen field. first time i enter the field it works fine, but every time after that it adds an extra option select list. with other words, after changing the value and reopening the field i have two select options. Then after closing and reopening i have three.. etc.. This only appears with the chosen plugin. When i use a normal select it works just fine. I also tried it with select2 and selectize, these also don't work well. But instead of duplicating the options list, they don't show a select list at al (just like the date popup).

i've put a simplified version here: https://macloudamsterdam.nl/test/

Anyone any idea what might be going on?

Thanks!
Wouter

Replies

  • allanallan Posts: 61,439Questions: 1Answers: 10,053 Site admin

    There is a chance that it is being caused by:

    $("dd").off('click');

    Also, could you change the postEdit event to be submitComplete please? postEdit is triggered when the element is still on the page and it might be incorrectly being removed and its event handlers destroyed.

    Thanks,
    Allan

  • wouterwouter Posts: 22Questions: 7Answers: 0
    edited July 2017

    Hi Allen,

    Thank you for your response! I tried both your suggestions but unfortunately both doesn't seem to fix the problem. I simplified the test script to eliminate as much as possible but still the same behaviour. But I did find out something else: this only happens with the inline editor. I tried the bubble editor and that seems ok. So i tried to see it it is the "submitComplete" and/or the "submit on blur" commented that out, but than i noticed something different, when i click update the editor doesn't close completely like it should. the edit fields stay visible. even though the value seems to submit just fine.

    I've updated the test here: https://macloudamsterdam.nl/test/index2.html
    and the one with the submitComplete removed: https://macloudamsterdam.nl/test/index3.html

    Curious to hear if your able to find something!

    Kind regards,
    Wouter

  • wouterwouter Posts: 22Questions: 7Answers: 0

    He guys!

    No one ever experienced this behaviour?

    Thanks!
    Wouter

  • allanallan Posts: 61,439Questions: 1Answers: 10,053 Site admin

    Hi Wouter,

    Sorry for the delay in getting back to you about this. I think I've spotted the issue. In the HTML there is:

    data-editor-id="835">

    Could you change it to be:

    data-editor-id="row_835">
    

    i.e. add the row_ prefix. That is what Editor is looking for when attempting to update the data from the Ajax response. I believe that should resolve it.

    Regards,
    Allan

  • wouterwouter Posts: 22Questions: 7Answers: 0

    You're right! That is indeed the problem! And the worst thing is, i think i made this error before. It solves all the strange behaviour at once....

    thanks!!!

This discussion has been closed.