• 项目管理软件dhtmlxGantt配置教程(七):如何自定义内联编辑器


    您可以指定自定义内联编辑器。为此,您需要通过以下方式创建一个新的编辑器对象:

    gantt.config.editor_types.custom_editor = {
      show: function (id, column, config, placeholder) {
        // called when input is displayed, put html markup of the editor into placeholder 
        // and initialize your editor if needed:
        var html = "
    "; placeholder.innerHTML = html; }, hide: function () { // called when input is hidden // destroy any complex editors or detach event listeners from here }, set_value: function (value, id, column, node) { // set input value }, get_value: function (id, column, node) { // return input value }, is_changed: function (value, id, column, node) { //called before save/close. Return true if new value differs from the original one //returning true will trigger saving changes, returning false will skip saving }, is_valid: function (value, id, column, node) { // validate, changes will be discarded if the method returns false return true/false; }, save: function (id, column, node) { // only for inputs with map_to:auto. complex save behavior goes here }, focus: function (node) { } }

    为了实现可重用的编辑器,需要记住一些关键点:

    • 作为一项规则,get_value不修改任务对象。该方法只返回内联编辑器的当前值。如果该值被认为有
  • 相关阅读:
    TypeScript算法题实战——二叉搜索树篇
    【JavaWeb】XML
    【Redis】Redis实现分布式锁
    98-docker命令
    Flutter的强制自我审查
    基于android实现的在线投票App毕业设计源码
    C++挑选书籍
    正点原子FreeRTOS(下)
    llamaindex原理与应用简介(宏观理解)
    云化Web IDE,在线开发新模式
  • 原文地址:https://blog.csdn.net/HD202202/article/details/127425097