datetime inline editing

datetime inline editing

awefawef231awefawef231 Posts: 1Questions: 1Answers: 0

https://editor.datatables.net/examples/inline-editing/simple.html

HI :)

I have two question about datetime inline editing using datepicker

one. is that possible edit when i was click date in datepicker without press enter key?
(default process is date td click -> date click in datepicker -> press enter -> edit! ,
but i want date td click -> date click in datepicker -> edit!)

two. in my table has two date field 'start date', 'end date' when i choose in start date, end date can't choose before start date,
(if start date is 2019/11/1, end date > 2019/11/1 AND end date > 2019/11/1, start date < 2019/11/1)

thank you :):)

This question has accepted answers - jump to:

Answers

  • colincolin Posts: 15,237Questions: 1Answers: 2,598
    Answer ✓

    Hi @awefawef231 ,

    one. is that possible edit when i was click date in datepicker without press enter key?

    I'm not seeing that. I can click on the "Start date" column, click a day on the datepicker, and it closes. I don't need to press enter at all. Can you give more details, please.

    two. in my table has two date field 'start date', 'end date' when i choose in start date, end date can't choose before start date,

    You can specify the minimum date with -opts.minDate, see here. This example here is doing what you want, I believe. I noticed a bug that sets the minimum day one day too early, so I've adjusted for that.

    Hope that helps,

    Cheers,

    Colin

  • colincolin Posts: 15,237Questions: 1Answers: 2,598
    Answer ✓

    Hi again,

    This is a better implementation here: http://live.datatables.net/sulehaxe/2/edit - it's using a method to set the minimum date, so tidied.

    Also, I see what you mean about the enter key - in the example now, it's submitting when the field is blurred, you don't have to press enter you can just click on anything else on the form.

    Hope that works,

    Cheers,

    Colin

This discussion has been closed.