Adding a button in the editor dialog

Adding a button in the editor dialog

Adrian ChallinorAdrian Challinor Posts: 21Questions: 8Answers: 0

Use Case is creating schedules using a CRON scheduler (Spring Boot internal scheduler). The cron format is tricky unless you are using it all the time. What I wondered is whether there is a way to add a button to open anther browser tab that explains cron formats and can construct one that can be copied.

Can I put html in the labelInfo, or would I be better creating a custom edit form?

Answers

  • Adrian ChallinorAdrian Challinor Posts: 21Questions: 8Answers: 0
    edited March 2023

    OH - Answered this. Yes, I can have html in the label Info. BRILLIANT!

            var editor = new $.fn.dataTable.Editor( {
                table : "#table", 
                ajax :  {
                    url : "/schedule/editor",
                    dataType : "json",
                    type: "POST",
                    contentType : "application/json",
                    data: function ( d ) {
                        return JSON.stringify( d );
                    }
                },
                idSrc : "id", 
                fields : [ 
                    { label : "Task Type", name: "type", type: "select"},
                    { label : "Directory", name: "backupID", type: "select"},
                    { label : "Chron:",    name: "cron",
                      labelInfo : '<a href="https://spring.io/blog/2020/11/10/new-in-spring-5-3-improved-cron-expressions" target="_blank">cron<\a>' 
                    }, 
                    { label : "Active:",   name: "active", 
                      type : "radio", 
                      options: {"Active": true, "Inactive": false}, 
                      def: true
                    }
                ]
            });
    
Sign In or Register to comment.