Hello i have two ui elements in my page. The first: datepicker was customized and change standard view to something that i need (you can see in snippet) but i don’t know how to achieve the same effect in datatable column, which has editor type “date”
https://snippet.webix.com/t1qpais4
Hi @roma,
You can create a custom editor with a custom popup. In you case you could extend the existing date editor.Change the setValue and getValue patterns and apply your custom popup there.
Please, check the snippet: Code Snippet
the only way it to create my extended pop up there is no option to customize existing popup of datatable ?
@pyrus_vagus i use this custom popup in few different datatables controls, and has event onChange how i may send specific datatable id and row id or even cell which was updated ?
@roma ,
the only way it to create my extended pop up there is no option to customize existing popup of datatable ?
the calendar you would like to have is a complex solution. Its configuration is different from the one in the existing popup of datatable. To make this work properly you have to adjust existing functionality to the other configuration.
Body
of the default date popup of datatable is a calendar:
body:{ view:"calendar", icons:true, borderless:true }
While body
of the desired one is layout with 2 calendars:
body: {
rows : [
{
view : "calendar",
id : "StartDateYearMonth",
css : "dateYearMonth",
type : "year",
height : 150
},
{
view : "calendar",
id : "StartDateMonthDay",
type : "day",
calendarHeader:"%F"
}
]
}
Without extending editor’s functionality it won’t work with this configuration.
@pyrus_vagus i use this custom popup in few different datatables controls, and has event onChange how i may send specific datatable id and row id or even cell which was updated ?
Could you please tell, which components are you applying the onChange
event on?
@pyrus_vagus onChange use in day part of custom popup
https://snippet.webix.com/o2kea58t
I need to achieve behavior when clicked on day it update value in datatable (as it work with default popup)
@roma , you can achieve such a behavior by calling webix onEditEnd
event, the same one that fires on date selection in default date editor. I would suggest you to use a save
button or something like that for calling this event. As using onChange
in day part can be tricky if a user haven’t selected the year fisrt or if they need to change only year for example.
Please, check the snippet: Code Snippet
using onAfterDateSelect and it work nice @pyrus_vagus thanks a lot for help!