Inline editor, keys and datepicker

Inline editor, keys and datepicker

simoncunsimoncun Posts: 16Questions: 5Answers: 0

Hi,

I have an inline editor and am using keys to tab and edit data. If i have a jquery UI datepicker field and do the following -

  1. Tab into the field, the datepicker appears as expected
  2. Choose a date with the mouse
  3. Hit tab to move to the next field

the cell has lost focus so hitting tab starts tabbing through the non datatables elements on the page.

Is there any way to suppress the blur event for that field (not the table) so it stays in focus? Is there a preblur event for the cell (not the table)?

I also get this problem when using the mouse to move the scrollbar in a selectize dropdown and I'm assuming it's the same issue. Some way of suppressing the blur would be useful if available.

Thanks.

Answers

  • allanallan Posts: 61,716Questions: 1Answers: 10,108 Site admin

    Very good point. What we need to do is have the input refocus when the date is selected. We can do that with the onChange callback.

    If you search the Editor source for:

    `buttonImageOnly: true

    And add a comma at the end of that line and then add:

                        onSelect: function () {
                            conf._input.focus();
                        }
    

    That will fix it.

    I'll include that in 1.6.2.

    Regards,
    Allan

  • simoncunsimoncun Posts: 16Questions: 5Answers: 0

    Thanks Allan,

    I had to change the code to

    onSelect: function () {
    conf._input.focus();
    conf._input.click();
    }

    Your suggestion would put focus back in the cell but if I hit tab it started tabbing through the non-datatables controls. With the click as well it works as I need. Thanks again.

  • allanallan Posts: 61,716Questions: 1Answers: 10,108 Site admin

    Ah - because of the KeyTable integration...

    I suspect that click is harmless without KeyTable, so I don't see an issue with that going in. Thanks for flagging that up.

    Allan

This discussion has been closed.