protected function getClientScriptOptions()
{
$options = parent::getClientScriptOptions();
$control = $this->getValidationTarget();
if (!$control instanceof TListControl) {
throw new TConfigurationException('listcontrolvalidator_invalid_control', $this->getID(), $this->getControlToValidate(), get_class($control));
}
$min = $this->getMinSelection();
$max = $this->getMaxSelection();
if ($min !== -1) {
$options['Min'] = $min;
}
if ($max !== -1) {
$options['Max'] = $max;
}
$required = $this->getRequiredSelections();
if (strlen($required) > 0) {
$options['Required'] = $required;
}
$options['TotalItems'] = $control->getItemCount();
return $options;
}