Datatables Editor Fields options list from DB

Datatables Editor Fields options list from DB

tomslloydtomslloyd Posts: 12Questions: 3Answers: 0
edited August 6 in Free community support

I have a few selects in the Datatable's Editor but i would like the placeholder to be selectable and not disabled from selection as below

<select id="DTE_Field_savings_type" class="form-control">
<option value="" hidden="" disabled="">Savings not Set</option>
<option value="1">Hours Per Week</option>
<option value="2">Engineer Accuracy Improvements</option>
<option value="3">Improved Customer Journey</option>
<option value="4">Man Power</option>
</select>

Config

                {
                    label: "Savings Type",
                    name: "request_management_tool.savings_type",
                    type: "select",
                    className: "chosen-select",
                    placeholder: "Savings not Set",
                    placeholderDisable: false,
                    placeholderValue: '',
                    attr: { disabled: false } 
                },

the above does not work for me, what is the way to do this i cannot seem to find an answer anywhere

i just want it to output like this

<select id="DTE_Field_savings_type" class="form-control">
<option value="">Savings not Set</option>
<option value="1">Hours Per Week</option>
<option value="2">Engineer Accuracy Improvements</option>
<option value="3">Improved Customer Journey</option>
<option value="4">Man Power</option>
</select>

please help

JS Version: DataTables 1.10.20, Editor 1.9.1, Buttons 1.6.0, Select 1.3.1
.NET Version: DataTables-Editor-Server.2.0.5

Answers

  • tomslloydtomslloyd Posts: 12Questions: 3Answers: 0
    edited August 6

    this is generated from a database select in .net to generate the list forgot to add that

  • allanallan Posts: 63,441Questions: 1Answers: 10,459 Site admin

    Editor 1.x is no longer supported, however, if you can give me a link to the page, I can take a look and see if there is something obvious going wrong that I can suggest a patch for.

    Regards,
    Allan

  • tomslloydtomslloyd Posts: 12Questions: 3Answers: 0

    i can not provide a link to a page as this is placed on an internal system, i can copy & paste code you need here for you to see. everything else works i am just unable to make the place holder a selectable value i have no console log errors and everything else seems to work.

  • tomslloydtomslloyd Posts: 12Questions: 3Answers: 0

    i feel like an idiot i just checked it all again and realised its this bit, i hat it as placeholderDisable and not placeholderDisabled was missing a letter.

    {
        label: "Savings Type",
        name: "request_management_tool.savings_type",
        type: "select",
        className: "chosen-select",
        placeholder: "Savings not Set",
        placeholderDisabled: false,
        placeholderValue: '',
        attr: { disabled: false }
    },
    
  • allanallan Posts: 63,441Questions: 1Answers: 10,459 Site admin

    Ah!!! I clean missed that as well. Well done spotting that - it could have been a long head scratcher that!

    Allan

Sign In or Register to comment.