That changeset didn't appear to mention the autoComplete control, which
was originally asked about.
I've noticed I had this same problem as well, not being able to easily
pass extra options to the Ajax.Autocompleter constructor, like minChar.
Any options passed to autoComplete() need be specified in $ajaxOptions
to make sure they don't show up in the htmlOptions for the input field,
but then it still doesn't make it to output in the Autocompleter
constructor. The __optionsForAjax method filters out any of the
options that are not in the $callbacks array or any options that are
not explicitly listed in the foreach/switch used internally.
I've been trying to test something simple like this:
echo $ajax->autoComplete('Instructor/fullname',
'/instructors/autocomplete', array('minChar'=>'2'));
Maybe _buildCallbacks() can be modified to replace valid callbacks and
leave other keys that don't match a callback the way they are and
return the modified array... maybe something like this?:
function _buildCallbacks2($options) {
foreach($this->callbacks as $callback) {
if (isset($options[$callback])) {
$name = 'on' . ucfirst($callback);
$code = $options[$callback];
$options[$name] = "function(request){" . $code
. "}";
unset($options[$callback]);
}
}
return $options;
}
Whoa.. that was cool, I tested that as I was writing this... anyways,
it seems like it might work? LMK if that sounds good/works for anyone
else?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~----------~----~----~----~------~----~------~--~---