How to set Editor form title

How to set Editor form title

divad.thgirbladivad.thgirbla Posts: 36Questions: 14Answers: 1

This is probably very basic but I can't get it to work. I want the Editor form to display a unique title, based on the form's content, each time it displays. I've tried it as an Editor attribute and as an onclick() event handler on #editButton but I always see "Edit Entry" as the Editor form's title.

    editor = new $.fn.dataTable.Editor( {
    ajax: "http://localhost:8080/XYZ/SaveScreenDataServlet?theSessionId=${theSessionId}", 
    template: '#customEditForm',        
    idSrc: 'id',    
    formOptions: { main: { focus: null, onBackground: 'none' } },  
    //display: 'jqueryui',    
    table: '#historyTable',
    title: 'Custom Form Title',

also

    $('#editButton').on( 'click', function () {
        editor.title("Custom Form Title" );
    } );     

Neither way works for me. I always see "Edit Entry".

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,143Questions: 1Answers: 2,586

    You can you use open, see example here.

    Colin

  • divad.thgirbladivad.thgirbla Posts: 36Questions: 14Answers: 1

    Thanks for the suggestion but this is still not working for me. I tried it in IE 11, Edge and Chrome and still always see "Edit Entry" as the Editor's form title. There's obviously something funky in my code so I think I'm going to have to strip it down to the very basics and see if I can get it working that way. I still have the issue of not being able to set the form's focus to null so that if a datetime field is the first field on the form, it doesn't automatically show its date picker window. Maybe stripping my code to the basics will solve that one too. I want to keep this ticket active until I do so.

    formOptions: { main: { focus: null, onBackground: 'none' } },
    
  • colincolin Posts: 15,143Questions: 1Answers: 2,586
    Answer ✓

    Again, that should work - see here - so it's likely to be related the form's title not changing. If you're able to modify that example to demonstrate those issues, we're happy to take a look.

    Colin

  • divad.thgirbladivad.thgirbla Posts: 36Questions: 14Answers: 1

    I stripped my customized code down to the bare bones and everything is now working the way it should with the date fields and form titles. There's obviously something wrong with my code so I'll start adding it back in gradually, testing to see what breaks and when. Thanks very much for your help.

This discussion has been closed.