I try to add Data Validation to a range with List as validation type.
- first row is disabled to show column titles
- my validation range is B2:B50
Data validation for the first cell (B2) is working, but oher cells in B column does not work.
Can you help me ?
The code:
<
div
id
=
"spreadsheet"
style
=
"width: 100%;"
></
div
>
$(
function
() {
var
spreadsheet = $(
"#spreadsheet"
).kendoSpreadsheet({
toolbar:
false
,
//sheetsbar: false,
sheets: [
{
rows: [
{
cells: [
{ value:
"Fonds"
},
{ value:
"Sens"
},
{ value:
"Code"
},
{ value:
"Quantité"
},
{ value:
"Cours"
}
]
}
]
},
{
name:
"ListAchatVente"
,
rows: [
{
cells: [
{
value:
"A"
},
{
value:
"V"
}
]
}
]
}
]
}).data(
"kendoSpreadsheet"
);
var
range = spreadsheet.activeSheet().range(
"1:1"
);
range.enable(
false
);
var
columnSens = spreadsheet.activeSheet().range(
"B2:B30"
);
columnSens.validation({
dataType:
"list"
,
from:
"ListAchatVente!A1:B1"
,
allowNulls:
true
,
type:
"reject"
,
titleTemplate:
"Valeur invalide"
,
messageTemplate:
"Valeur autorisée: 'A' ou 'V'."
});
});