本文整理匯總了PHP中FabrikHelperHTML::autoCompletOptions方法的典型用法代碼示例。如果您正苦於以下問題:PHP FabrikHelperHTML::autoCompletOptions方法的具體用法?PHP FabrikHelperHTML::autoCompletOptions怎麽用?PHP FabrikHelperHTML::autoCompletOptions使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類FabrikHelperHTML
的用法示例。
在下文中一共展示了FabrikHelperHTML::autoCompletOptions方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: autoComplete
/**
* Add autocomplete JS code to head
* @param string $htmlid of element to turn into autocomplete
* @param int $elementid
* @param string $plugin
* @param array $opts (currently only takes 'onSelection')
*/
public function autoComplete($htmlid, $elementid, $plugin = 'field', $opts = array())
{
FabrikHelperHTML::autoCompleteScript();
$json = FabrikHelperHTML::autoCompletOptions($htmlid, $elementid, $plugin, $opts);
$str = json_encode($json);
FabrikHelperHTML::addScriptDeclaration("head.ready(function() { new FbAutocomplete('{$htmlid}', {$str}); });");
}
示例2: elementJavascriptOpts
function elementJavascriptOpts($repeatCounter)
{
$params =& $this->getParams();
$element = $this->getElement();
$opts = $this->_getOptionVals();
$data =& $this->_form->_data;
$arSelected = $this->getValue($data, $repeatCounter);
$arVals = $this->getSubOptionValues();
$arTxt = $this->getSubOptionLabels();
$table = $params->get('join_db_name');
$opts =& $this->getElementJSOptions($repeatCounter);
$forms =& $this->getLinkedForms();
$popupform = $params->get('databasejoin_popupform');
$popuplistid = empty($popupform) || !isset($forms[$popupform]) ? '' : $forms[$popupform]->listid;
$opts->id = $this->_id;
$opts->key = $table . "___" . $params->get('join_key_column');
$opts->label = $table . "___" . $params->get('join_val_column');
$opts->formid = $this->getForm()->getForm()->id;
$opts->listid = $popuplistid;
$opts->value = $arSelected;
$opts->defaultVal = $this->getDefaultValue($data);
$opts->popupform = $popupform;
$opts->popwiny = $params->get('yoffset', 0);
$opts->display_type = $params->get('database_join_display_type', 'dropdown');
$opts->windowwidth = $params->get('join_popupwidth', 360);
$opts->displayType = $params->get('database_join_display_type', 'dropdown');
$opts->show_please_select = $params->get('database_join_show_please_select');
$opts->showDesc = $params->get('join_desc_column') === '' ? false : true;
$opts->autoCompleteOpts = $opts->display_type == 'auto-complete' ? FabrikHelperHTML::autoCompletOptions($opts->id, $this->getElement()->id, 'databasejoin') : null;
$opts->allowadd = $params->get('fabrikdatabasejoin_frontend_add', 0) == 0 ? false : true;
if ($this->isJoin()) {
$join =& $this->getJoin();
$opts->elementName = $join->table_join;
$opts->elementShortName = $element->name;
}
$opts = json_encode($opts);
return $opts;
}
示例3: autoComplete
/**
* Add autocomplete JS code to head
* @param string $htmlid of element to turn into autocomplete
* @param int $elementid
* @param string $plugin
* @param array $opts (currently only takes 'onSelection')
*/
public function autoComplete($htmlid, $elementid, $plugin = 'fabrikfield', $opts = array())
{
FabrikHelperHTML::autoCompleteScript();
$json = FabrikHelperHTML::autoCompletOptions($htmlid, $elementid, $plugin, $opts);
$str = FastJSON::encode($json);
FabrikHelperHTML::addScriptDeclaration("window.addEvent('domready', function() { new FabAutocomplete('{$htmlid}', {$str}); });");
}