Open JohnRSim opened 3 years ago
i doubt this helps cause it isnt helping me, but this is how a different plugin does it: https://codesandbox.io/s/revogrid-staticjs-column-jvztc?file=/index.html
no clue how to make that work on this plugin
grid.columnTypes = { 'date': new index.Revogrid.DateColumnType() }; this will make it show the calendars but i dont think this was made for use without webpack cause the next error comes when you try to change the date. i think there was no documentation for this because the vanilla way has to be developed ;[
adding the module version of the duet js got me a kinda-working datepicker. selecting a date gives me undefined and this just wasnt made for this, im out
im back. Forget this plugin if you're using vanilla, it isnt made for it. The option im gonna go with so far is by changing the input to a type=date input which gives me a date picker in modern browsers. This is done using Revogrid's custom cell editor. https://revolist.github.io/revogrid/guide/cell.editor.html
function customEdit(column, saveCallback, closeCallback) {
return {
element: null, // will be setup up after render
editCell: null, // will be setup up after render
/**
* required, define custom component structure
* @param createElement: (tagName: string, properties?: object, value?: any, children: Array) => VNode
*/
render(createElement) {
return createElement('input',{ type:'date' });
},
componentDidRender() {
//further change the component
}, // optional, called after component rendered
disconnectedCallback() {}, // optional, called after component destroyed
};
};
/*
your other init code
*/
grid.editors = {
"custom" : customEdit
}
We never intended to use it in vanilla, the best proposal is from @hightowertech! We do support exposure for vanilla js but it was never tested or intended to be used.
https://github.com/revolist/revogrid-column-date/blob/v2.0.20/lib/index.ts
Can you provide a vanilla example similar to select?
Thanks