I would like to change the title of the Kanban popup editor as well as control it’s width and height (ideally 90% of the page width, I need a lot of fields on the form).
I’ve spent a couple of hours searching the examples and forum but can’t find one example of how to do this, can anyone offer a snippet of code ?.
To change the title of the editor you can use the onAfterEditorShow event. Using queryView({localId:“$kanban_header”}) you can find the title of the popup editor and change it with the define method.
As for the editor size, by default the Kanban editor’s size is adjusted to the sizes of the form controls (you can define height and width for the particular view in the editor.) You can use getEditor method to get the editor and with the help of the define method to set the width of the whole editor window.
As for responsive width of the editor, you need to use the define method as well and change the position property. The position can be a function which recieves the state parameter. And you can adjust this parameter to the responsive values you need:
To have a lot of fields in the popup editor you may need to put the editor’s body into a scrollview. With the help of the protoUI() method, we are able to either create a new custom component or redefine an existing one.
So, we could change the structure of the editor in the protoUI - $init function this way:
webix.protoUI({
name: "kanbaneditor", //name of the editor view used in Kanban
$init: function (config) {
let cfg = webix.copy(config.body);
config.body = {
view: "scrollview", body: cfg
}
}
}, webix.ui.kanbaneditor);
Please see the snippet with the example: Code Snippet
An editor in Kanban is based on a window where a form with editor fields and bottom buttons are located in editor.config.body, while a title is located in editor.config.head.
For easiest searching inside the editor some elements have a built-in localId property, by which we can find the desired element using queryView .