Select with multiple columns

Select with multiple columns

slcoslco Posts: 3Questions: 2Answers: 0

Hi,

I would like to visualize in a field type: SELECT two columns.
I've manage to create the SELECT type and it is showing correctly in the browser, however the column of the table contains many identical values so I need to add a second column of the same tabel in the SELECT view in order to identify the right record to choose.
Could you please let me know what I have to add to below the code:

var editor = new $.fn.dataTable.Editor( {
"ajax": "php/table.Servers.php",
"table": "#Servers",
"fields": [
{
"label": "Credentials",
"name": "Servers.CustomerCredentialID",
"type": "select"
}
]

and
$('#Servers').DataTable( {
"columns": [
{
"data": "CustomerCredentials.CustomerUserName"
}
]

Thanks.

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,522Questions: 1Answers: 10,473 Site admin
    Answer ✓

    Do you mean you want to show information from two different database columns in the select option labels? If so, you can provide the fields list to use as an array, as described in the documentation and shown in this example (assuming you are using the provided PHP libraries).

    Allan

  • slcoslco Posts: 3Questions: 2Answers: 0

    Hi Allan,

    Thank you very much!
    That´s exactly I was looking for.

This discussion has been closed.