本文整理匯總了PHP中FabrikHelperHTML::autoCompleteScript方法的典型用法代碼示例。如果您正苦於以下問題:PHP FabrikHelperHTML::autoCompleteScript方法的具體用法?PHP FabrikHelperHTML::autoCompleteScript怎麽用?PHP FabrikHelperHTML::autoCompleteScript使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類FabrikHelperHTML
的用法示例。
在下文中一共展示了FabrikHelperHTML::autoCompleteScript方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: _filterJS
/**
* if used as a filter add in some JS code to watch observed filter element's changes
* when it changes update the contents of this elements dd filter's options
* @param bol is the filter a normal (true) or advanced filter
* @param string container
*/
function _filterJS($normal, $container)
{
$params =& $this->getParams();
$element =& $this->getElement();
$observerid =& $this->_getWatchId();
$observerid .= "value";
if ($element->filter_type == 'auto-complete') {
FabrikHelperHTML::autoCompleteScript();
$htmlid = $this->getHTMLId() . 'value';
$opts = new stdClass();
$opts->observerid = $observerid;
$opts->url = COM_FABRIK_LIVESITE . 'index.php?option=com_fabrik&format=raw&controller=plugin&task=pluginAjax&g=element&element_id=' . $element->id . '&plugin=' . $this->_pluginName . '&method=autocomplete_options';
$opts = json_encode($opts);
FabrikHelperHTML::addScriptDeclaration("window.addEvent('domready', function() { new FabCddAutocomplete('{$htmlid}', {$opts}); });");
}
if ($element->filter_type == 'dropdown') {
$default = $this->getDefaultFilterVal($normal);
$observed =& $this->_getObserverElement();
$filterid = $this->getHTMLId() . 'value';
$tableModel =& $this->getTableModel();
$formModel =& $tableModel->getForm();
FabrikHelperHTML::script('filter.js', 'components/com_fabrik/plugins/element/fabrikcascadingdropdown/');
$opts = new stdClass();
$opts->formid = $formModel->_id;
$opts->filterid = $filterid;
$opts->elid = $this->_id;
$opts->liveSite = COM_FABRIK_LIVESITE;
$opts->def = $default;
$opts->filterobj = 'filter_' . $container;
$opts = json_encode($opts);
return "filter_{$container}.addFilter('{$element->plugin}', new CascadeFilter('{$observerid}', {$opts}));\n";
}
}
示例2: 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}); });");
}
示例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}); });");
}
示例4: _filterJS
/**
* if used as a filter add in some JS code to watch observed filter element's changes
* when it changes update the contents of this elements dd filter's options
* @param bol is the filter a normal (true) or advanced filter
* @param string container
*/
function _filterJS($normal, $container)
{
$params =& $this->getParams();
$element = $this->getElement();
$observerid =& $this->_getWatchId();
$observerid .= "value";
if ($element->filter_type == 'auto-complete') {
FabrikHelperHTML::autoCompleteScript();
$htmlid = $this->getHTMLId() . 'value';
$opts = new stdClass();
$opts->observerid = $observerid;
$opts->url = COM_FABRIK_LIVESITE.'/index.php?option=com_fabrik&format=raw&view=plugin&task=pluginAjax&g=element&element_id='.$element->id.'&plugin=cascadingdropdown&method=autocomplete_options';
$opts = json_encode($opts);
FabrikHelperHTML::addScriptDeclaration(
"head.ready(function() { new FabCddAutocomplete('$htmlid', $opts); });"
);
}
if ($element->filter_type == 'dropdown') {
$default = $this->getDefaultFilterVal($normal);
$observed =& $this->_getObserverElement();
$filterid = $this->getHTMLId() . 'value';
$listModel =& $this->getlistModel();
$formModel =& $listModel->getForm();
FabrikHelperHTML::script('plugins/fabrik_element/cascadingdropdown/filter.js');
$opts = new stdClass();
$opts->formid = $formModel->get('id');
$opts->filterid = $filterid;
$opts->elid = $this->_id;
$opts->def = $default;
$opts->filterobj = 'filter_' . $container;
$opts = json_encode($opts);
return "filter_{$container}.addFilter('$element->plugin', new CascadeFilter('$observerid', $opts));\n";
}
}
示例5: filterJS
/**
* If used as a filter add in some JS code to watch observed filter element's changes
* when it changes update the contents of this elements dd filter's options
*
* @param bool $normal is the filter a normal (true) or advanced filter
* @param string $container container
*
* @return void
*/
public function filterJS($normal, $container)
{
$params = $this->getParams();
$element = $this->getElement();
$observerid = $this->_getWatchId();
$observerid .= 'value';
if ($element->filter_type == 'auto-complete') {
FabrikHelperHTML::autoCompleteScript();
$htmlid = $this->getHTMLId() . 'value';
$opts = new stdClass();
$opts->observerid = $observerid;
$app = JFactory::getApplication();
$package = $app->getUserState('com_fabrik.package', 'com_fabrik');
$opts->url = COM_FABRIK_LIVESITE . '/index.php?option=com_fabrik&format=raw&view=plugin&task=pluginAjax&g=element&element_id=' . $element->id . '&plugin=cascadingdropdown&method=autocomplete_options&package=' . $package;
$opts = json_encode($opts);
FabrikHelperHTML::addScriptDeclaration("head.ready(function() { new FabCddAutocomplete('{$htmlid}', {$opts}); });");
}
if ($element->filter_type == 'dropdown') {
$default = $this->getDefaultFilterVal($normal);
$observed = $this->_getObserverElement();
$filterid = $this->getHTMLId() . 'value';
$formModel = $this->getForm();
FabrikHelperHTML::script('plugins/fabrik_element/cascadingdropdown/filter.js');
$opts = new stdClass();
$opts->formid = $formModel->get('id');
$opts->filterid = $filterid;
$opts->elid = $this->_id;
$opts->def = $default;
$opts->filterobj = 'Fabrik.filter_' . $container;
$opts = json_encode($opts);
return "Fabrik.filter_{$container}.addFilter('{$element->plugin}', new CascadeFilter('{$observerid}', {$opts}));\n";
}
}