Quantcast
Viewing all articles
Browse latest Browse all 82110

Json loaded table with jeditable and datepicker (jquery/ui) problems with month switch

Hi All

I am using a json loaded datatable with the jEditable plugin and the jQuery/UI date picker and having some problems.

I used Eric_DeCoff's sample code (http://www.datatables.net/forums/discussion/1723/editable-with-datepicker-inside-datatables/p1) to get the basic functionality running. (Thanks Eric!)

When I open a datepicker and click on a date it works as anticipated.

When I select the next or prev month button (top left and right) on the date picker, the datepicker moves, then seems to trigger the close/save event on the item being edited (I assume because the input element goes away and it returns to its original "pre dblclicked" state with no change in the value) and stops the component from working.

From my hunting around there was some talk or the blur event from the input box being a problem, but its caught here:
// override normal blur function ( needed for date month switching )
$('#jobtable tbody td.ui-datepicker-inline input').live('blur', function(e) {
        return false;
});

All I can think of is that the jEditable component is triggering a blur event and its internal save function before the calendar has a chance to move months and before it can be overwritten by the line above.

I have checked the flow, and the onblur event is triggered before the calendar moves, or the input box is removed from the cell.

By following the even through the debugger it seems to run about a dozen return false loops and cancels everything.

Does anyone have a better way of achieving this?

Thanks in advance

Viewing all articles
Browse latest Browse all 82110

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>