Editor template

Editor template

LapointeLapointe Posts: 373Questions: 70Answers: 4

I can't setup editor template...

I put a div section as shown in https://editor.datatables.net/examples/styling/template
but what I get is a form before the table and when editing a single row ....

<body class="dataTables">
<div class="container">
    <div id="customForm">
            <fieldset class="name">
                <div data-editor-template="clients.ID_Civilites"></div>
                <div data-editor-template="clients.Prenom"></div>
                <div data-editor-template="clients.Nom"></div>
            <fieldset class="address">
                <div data-editor-template="clients.Adresse"></div>
                <div data-editor-template="clients.Adresse_Suite"></div>
                <div data-editor-template="clients.CodePostal"></div>
                <div data-editor-template="clients.ID_Commune"></div>
            <fieldset class="office">
                <div data-editor-template="clients.Email"></div>
                <div data-editor-template="clients.Telephone"></div>
            <fieldset class="Divers">
                <legend>HR info</legend>
                <div data-editor-template="Actif"></div>
    <table id="donnees" class="display" style="width:100%">
            <tr style="text-align:left">
            <tr style='text-align:left'>

so I get

        editor = new $.fn.dataTable.Editor( {     // initialisation de l'editeur
            ajax: {
                url: "getdata.php",
                type: 'POST',
                dataType: 'JSON',
                data: function(d){
            template: '#CustForm',
                        table: "#donnees",

and at editing time

I try using data-editor-template or

       <editor-field name="clients.ID_Civilites"></editor-field>

I know there is a way to do it but...


  • kthorngrenkthorngren Posts: 13,818Questions: 25Answers: 3,254

    Your custom form div is this:

    <div id="customForm"> ... </div>

    But your template option is this:

    template: '#CustForm',

    The IDs don't match.


  • LapointeLapointe Posts: 373Questions: 70Answers: 4

    Hi @kevin1293909
    A newbee error...
    I'm stupid.


  • LapointeLapointe Posts: 373Questions: 70Answers: 4

    Hi @all

    Do you think there is a way to use tabs in editor... on same record of course, like for many columns table, grouping inputs in tabs ?
    Tabs in editor or editor(s) in tab ?

    Bob (also posted in another part about tabs)

  • allanallan Posts: 54,718Questions: 1Answers: 8,561 Site admin

    Hi Bob,

    Absolutely you can use tabs inside a custom template. Just initialise them as you would do with any other tab group (assuming you have a tabbing library on your site already).


Sign In or Register to comment.