Placeholder not working for Editor type 'datetime'

Placeholder not working for Editor type 'datetime'

CapamaniaCapamania Posts: 233Questions: 81Answers: 5
edited September 2016 in Editor

The placeholder for type 'datetime' is not working. For type: "select" it is working. Any specific reason why?

editor = new $.fn.dataTable.Editor( {
        ajax: "source.php",
        table: "#my-table",
        fields: [ {
                label: "Field 1:",
                name: "field_01",
                type:  "select",
                placeholder: "Select a Value",
                options: [
                    { label: 'Value 01', value: '1' },
                    { label: 'Value 02', value: '2' }
                ]               
            } {
                label: "Field 2:",
                name: "field_02",
                type:  "datetime",
                placeholder: "YYYY-MM-DD",
                def:   function () { return new Date(); }
            }
        ]
    } );

This question has an accepted answers - jump to answer

Answers

  • CapamaniaCapamania Posts: 233Questions: 81Answers: 5
    edited September 2016

    ... never mind, it worked with ...

    editor = new $.fn.dataTable.Editor( {
            ajax: "source.php",
            table: "#my-table",
            fields: [ {
                    label: "Field 1:",
                    name: "field_01",
                    type:  "select",
                    placeholder: "Select a Value",
                    options: [
                        { label: 'Value 01', value: '1' },
                        { label: 'Value 02', value: '2' }
                    ]              
                } {
                    label: "Field 2:",
                    name: "field_02",
                    type:  "datetime",
                    attr:  {
                placeholder: YYYY-MM-DD'
                },                
                    def:   function () { return new Date(); }
                }
            ]
        } );
    
    
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Answer ✓

    Yes, that's the correct way to do it. Thanks for posting back.

    Allan

This discussion has been closed.