Field Tool Tip Feature

Field Tool Tip Feature

aziegler3aziegler3 Posts: 21Questions: 3Answers: 0
edited April 2013 in Editor
Just getting started with Editor for DataTables and wondering if there is a way to include "Tool Tip" like feature on each of the fields in an editor instance in order to define the nature of the field and any possible constraints.

I would like this field "help" to be included within the editor instance.

Thanks in advance...

Replies

  • allanallan Posts: 61,635Questions: 1Answers: 10,092 Site admin
    Hi,

    There are a couple of options. The first is to use the `node` method to get the elements which Editor uses for a particular field ( http://editor.datatables.net/api/#node ). You could use this to add an attribute to the `label` tag - for example:

    [code]
    $('label', editor.node('myField')).attr( 'title', "Tooltip text" );
    [/code]

    If you want something more complex, but still tooltip based, you could then run a tooltip library over that new title attribute (i.e. rathe than using the browser's built in tooltips - which can be a bit ugly!).

    The final option is to create a new field input type with completely custom HTML. That method is described here: https://editor.datatables.net/tutorials/field_types

    Regards,
    Allan
  • aziegler3aziegler3 Posts: 21Questions: 3Answers: 0
    edited April 2013
    Thanks Allan - we went with the first option and it worked just fine.
This discussion has been closed.