Autocomplete with inline editing

Autocomplete with inline editing

ladokjohanladokjohan Posts: 15Questions: 3Answers: 0

Hi,

I am trying to use autocomplete together with inline edit icon. If I click the New or Edit buttons autocomplete works. However, when using inline editing I can't save the changes for autocomplete fields and textfields (it works for text fields). The autocomplete values are shown and can be selected but I can't save them by pressing Enter. And in textfields Enter gives, of course, a new row. How can it be solved so I can save all changes made inline?

I don't want to paste the code here, but can send it to Allan if needed.

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    Hi,

    So the problem here is that I don't know how to determine if the return key is being pressed to select an item in the AutoComplete list, or if it is being used to submit the form.

    Editor does have a callback function that is available to plug-ins (canReturnSubmit) that allows the field to determine if the return key should submit or not. I've just tried experimenting with the jQuery UI AutoComplete, and I can't find a way to tell if the return was on the input or an item in the list.

    I tried to see if any of the elements in the list have focus, but that appears to get removed before the canReturnSubmit callback happens. Checking if the list is visible or not also as the same issue.

    If I can determine if the return was for an item or a submit action its fairly easy to control Editor's action, but currently I don't see a way to do that in jQuery UI I'm afraid.

    Allan

  • ladokjohanladokjohan Posts: 15Questions: 3Answers: 0

    Hi,

    Thanks for your answer. In this case I solved the problem by using autocomplete together with Submit on blur for selected columns only. That combo seem to work fine and gives the same functionality I need with only small diffences compared to Edit icon.

  • wohlgemuthwohlgemuth Posts: 3Questions: 1Answers: 1

    would it be possible to see a code example how you solved this?

    thanks!

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    I suspect that it is a form of this example. Selected columns would use onBlur: 'submit', while others wouldn't.

    Allan

  • chelarienchelarien Posts: 3Questions: 1Answers: 0

    Thanks guys, same issue for me with autoComplete and inline editing, and the onBlur solved it

This discussion has been closed.