-
Notifications
You must be signed in to change notification settings - Fork 284
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: DataTables Editor DateTime picker support. #535
Comments
@VictorioBerra what datetime picker library is being used by DT ? |
@vedmack It's his very own built right into the editor. The docs are kind of sparse unless you have an account https://editor.datatables.net/reference/field/datetime But if you grab the trial editor here then you should be able to see the source code so you can see the options. i think it makes heavy use of the onChange event for clicks. |
@VictorioBerra , If you provide me with docs (events / etc) for that datetime plugin, or add some code to its init where you will modify its |
@vedmack this should help. http://live.datatables.net/loqacefa/1/edit The datepicker will always call onChange when a date is click. Unfortunately, it does not send any arguments to the callback BUT it does set datepicker.s.d to a new Date. Using this, you should be able to keep a reference to the date picker and incorporate it into the library. Also, it takes a bunch of options:
So you may want to create a way for the user to pass those up maybe via |
And here is the nasty hack to get it to work in its current state http://live.datatables.net/punakiva/1/edit |
@VictorioBerra how to I access that datepicker.s.d? It looks like the best way to integrate this datepicker is to use |
@vedmack Right now it is a property on the |
He replied. Scheduled for the next editor release. |
make sure that there will be events to listen to (with target element so it will be possible to tell who triggered the event) |
Is misanek Allan? |
No, I am not :) I just follow this thread, because this feature would be useful for me too :) |
@vedmack Its out! https://editor.datatables.net/download/1.9.0
|
@VictorioBerra plz provide a working jsfiddle with the new datatables code / etc... |
@vedmack Im not sure what youre asking for exactly, the code samples above should be all thats needed. Everything is the same except the onChange event now contains the selected value as a string and the selected value as a http://live.datatables.net/totadepa/1/edit See that sample and then see the console. Now I think you just need to finish the code on your side to tap into that. |
@VictorioBerra please take a look at this http://live.datatables.net/totadepa/1/edit and let me know how it work for you |
@vedmack This is great thanks a lot for your work on this. Really nice to lean into the Editors date picker. Feel free to close when you deploy. |
added in 0.9.4.beta.24 |
I paid for the Editor and it comes with a DateTime picker. So rather than getting yet another dependency id love to use the one I already have. Also it will help with consistency with the rest of my site.
Sample
http://live.datatables.net/mohuxobu/1/edit?html,js,output
Code
Click inside the name textbox.
Maybe I missed it, but is there some init function that gives me access to the element that YADCF creates? This would make doing stuff like that all the much easier. Although, if possible it would be nice if it was built into yadcf so I could control it just like I would with jQuery DateTimePicker. As you can see by the sample yadcf will have to tap into some events. You have to hit a key for example to trigger yadcf to perform the search even after selecting the date.
The text was updated successfully, but these errors were encountered: