I am making a custom page, in which there are multiple fields that need a date-time picker.
Is there any way to initialize the datetime picker without using other libraries or plugins.
I came across frappe.ui.form.make_control, but was unable to get it to work.
Can someone please help me get it running.
Thanks
Also it is not working for multiple input fields.
I have n rows having class .contact_date. I need the picker to initialize on all rows having that class.
Right now it initializes only on the first one.
Okay, I got the picker to work, but the default is not working. One option i had was to use frappe.set_value() but that triggers the change event, which is a problem.
This is what I have done, where am I making a mistake?
It sounds like you’re well into this process, but I would have done this as a single doctype and rendered any extra HTML to an HTML field. It’s a little more work to set up but really for almost any form-type interface it is my opinion that a doctype is a better starting point. That said, for people who are coming from environments like Django or Flask, I can see how the page is appealing and the doctype seems too limited. ::off topic. sorry::
Well, I am creating a separate page for an existing doctype i.e. Lead, for quick actions like changing the next contact date, lead status and adding remarks.
So creating another doctype is not exactly feasible here.
Interesting. How does it compare with a quick entry or a custom dialog? And is it internal or external facing (like regular system users vs external salespeople signing on to drop in this info?
Personally, I’d still probably gone with a single, but I’m very comfortable in that context and less so in others and it would be a personal choice.
It is actually integrated in the list view.
In the default lead list, we can have only 4 columns with only that much fields.
The page is set up to be an alternative to the default list view for the leads doctype with fields like status and next contact date directly updatable without opening the single docname.
I think you want to make a date or datetime docfield. Here’s an example with a checkbox that will get you most of the way there. The date picker (should?) come with the docfield.
I created the datetime picker field using frappe.ui.form.make_control, I am having difficulty setting a default value to it, without triggering the change event.
Hey @saeedkola, you’ve inspired me to do re-imagine what the list view should look like for Projects. How are you redirecting to your new page-based view?