datetimefield/dependent
datetimefield/dependent
following on from a previous thread
http://datatables.net/forums/discussion/31507/
I am having a problem with the editor (1.5.3) datetimefield/dependent
editor.dependent( 'tblevent.EventDate', function ( val ) {
editor.field( 'tblevent.EventDateTo' ).val( val );
},
{event: 'change'}
);
If I set the event to for example, focusout, the editor instance opens ok, but if I set it to change, the editor does not open, and I get an error
dataTables.editor.js:569 Uncaught TypeError: Cannot read property 'length' of undefined
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Interesting - I can reproduce that using this example with the following code (
change
is the default):Sorry about this error! Let me look into it and I'll post back as soon as I've got the fix.
Allan
Trying to think of a workaround
What I want to do is set the value of additional date fields in my editor to the same as the start date on changing the start date value
I tried adding the following code to my page
but this gives me an error
dataTables.editor.js:569 Uncaught TypeError: Cannot read property 'length' of undefined
Also, a couple of general datapicker questions...
is it possible to close the datepicker when tabbing through the editor ? - as my datepicker instance stays open unless i click.
can i add dates going back prior to 2005 ?
Thanks
UPDATE
I changed the datepicker, so I am now using the bootstrap-datetimepicker 2
http://editor.datatables.net/plug-ins/field-type/editor.datetimepicker-2
This is working well, no errors, but the code i posted above doesn't fire on change, (though it does fire on mouseover, on blur ...
Hi,
I've just dropped you an e-mail about the above issue, but regarding this:
That's a bug - will be fixed in 1.5.4 - thanks!
Yes. The range can be extended using the
opts.yearRange
option of thedatetime
field type.Allan