Editor shows field-messages only on first load

Editor shows field-messages only on first load

rostrost Posts: 26Questions: 9Answers: 1

My editor shows everything (including field-messages) fine when loaded the first time - when invoked a second (and further) times, it still shows everything - but without the field-messages. Who could please give me a hint what to do?

My editor-code starts like

(function($) {

  $(document).ready(function() {
    var editor = new $.fn.dataTable.Editor({
      ajax: 'php/table.ML_03.php',
      table: '#AL-04',
      fields: [
        {
          // "label": "F05_Beschreibung ausführlich:",
          "label": "Link zur Webseite:",
          "name": "f05_beschreibung_ausfhrlich",
          "message": "Bitte einen Verweis auf eine Website. Format: http://test.de [05]"
        },
[...]

The buttons start with

      select: true,
                    
                    buttons: [
                        { extend: 'create', editor: editor, text: 'neuer Eintrag', title: 'Neues Angebot erfassen', formButtons: [
                    'Speichern',  { text: 'Abbrechen', action: function () { this.close(); } }
                ]}, 
                        
                        { extend: 'edit',   editor: editor, text: 'Bearbeiten', title: 'Ausgewähten Eintrag bearbeiten', formButtons: [
                    'Änderung speichern',  { text: 'Abbrechen', action: function () { this.close(); } }
                ]},
[...]

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    That's odd, there's no reason why that should be the case. Are you able to link to your page, or modify this example, so we can see the issue, please.

    Colin

  • rostrost Posts: 26Questions: 9Answers: 1

    Thanks for providing that example (http://live.datatables.net/wegowafu/150/edit) - I did a little modification on the .js:

    • 'on click' is commented out (end of js) because I want to use the editor-form
    • a message is added to field 'name'

    Now my issue is reproducable:

    • select one row
    • click button "edit" => the field message is to be seen in the form opening => close that form
    • repeat the last step => the field message has vanished

    Hopefully my description is clear enough...

    Thanks for helping!

  • colincolin Posts: 15,240Questions: 1Answers: 2,599
    Answer ✓

    Thanks for that. fields.message is intended for dynamic information, messages that come and go, it's not expected to be permenant (there's a message to that effect on the reference page). If you use fields.fieldInfo, that'll do what you want - see here.

    Colin

  • rostrost Posts: 26Questions: 9Answers: 1

    That's it, thank you! :-)

This discussion has been closed.