Editor form button to show/hide fieldInfo

Editor form button to show/hide fieldInfo

Loren MaxwellLoren Maxwell Posts: 332Questions: 77Answers: 9
edited August 5 in Editor

I remember seeing an example a few months ago of adding a custom button to an editor form that would toggle the visibility of the fieldInfo for all the fields (i.e., a "Help" button on the form that would show/hide the fieldInfo information).

I meant to bookmark it, but I cannot find it now even though I've been searching through the forums.

Does anyone know offhand where that example is?

Answers

  • allanallan Posts: 56,423Questions: 1Answers: 8,955 Site admin

    Doesn't ring any bells for me I'm afraid. I'd guess that it used fields() to get all of the field names, then loop over that and use field().node() to get the container node for the field and finally manipulate the DOM (probably the display properly) for the field info elements.

    Allan

  • Loren MaxwellLoren Maxwell Posts: 332Questions: 77Answers: 9
    edited August 5

    Thanks @allen, that might have been how they approach it.

    I was thinking of using jQuery to hide fieldInfo (data-dte-e="msg-info") in the Editor form open event:

    var editor = new $.fn.dataTable.Editor({
        . . .
    }).on( "open", function (e, mode, action) {
        $('[data-dte-e="msg-info"]').hide()
    })
    

    and then add a button on the Editor form to make them visible again as a Help button.

    I haven't programmed it yet, although I think it's simple enough, but I was hoping to see the other example first to see what their approach was.

Sign In or Register to comment.