select in 3 posistion
select in 3 posistion
rrzavaleta
Posts: 78Questions: 52Answers: 2
I am using the example of
https://editor.datatables.net/examples/api/dependentFields.html
But I have the need to do 3 states in the select
I could not make the comparison of these three states.
{
label: "Show options:",
name: "options",
type: "select",
options: [ "1", "2","3" ],
def: "3"
},
ditor.dependent( 'options', function ( val )
{
return val === '1' ?
{ show: ['position', 'office'] }:
{ hide: [ 'extn', 'start_date', 'salary'] } ;
return val === '2' ?
{ show:[ 'extn', 'start_date', 'salary'] }:
{ hide: ['position', 'office'] } ;
return val === '3' ?
{ hide: [ 'extn', 'start_date', 'salary','position', 'office'] } ;
}
I'm planning to do the same process but with more ..but fields compared to the example I served 3
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
You have three different return statements and only the first will actually return. You need to use a simple
if
condition.Allan
Thanks allan my problem was the "return"