Reputation: 93
I always got an error: Property "TbDatePicker.hint" is not defined. and when I comment it, it also got an error: Property "TbDatePicker.prepend" is not defined.
My code:
echo $form->datepickerRow($formModel,'date',
array(
'options' => array('language' => 'es'),
'hint' => 'Click inside! This is a super cool date field.',
'prepend' => '<i class="icon-calendar"></i>'
)
);
Upvotes: 0
Views: 1034
Reputation: 166
I was looking for the same error today. The function definition of datePickerRow (see TbActiveForm.php) is:
public function datePickerRow($model, $attribute, $widgetOptions = array(), $rowOptions = array())
According to TbActiveForm class information (in the beginning of the corresponding file), it says that both hint and prepend are rowOptions, so to make your datePicker function you have to rewrite your code as follows:
echo $form->datepickerRow(
$formModel,
'date',
array('options' => array('language' => 'es'),),
array(
'hint' => 'Click inside! This is a super cool date field.',
'prepend' => '<i class="icon-calendar"></i>'
)
);
The only thing I couldn't deal with, is that the prepended icon gets slightly above the input field.
Upvotes: 2