Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
autocomplete_deluxe
Manage
Activity
Members
Labels
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
drupal.org
autocomplete_deluxe
Commits
d43fb612
Commit
d43fb612
authored
13 years ago
by
sepgil
Browse files
Options
Downloads
Patches
Plain Diff
Added api documentation.
parent
86e00101
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
autocomplete_deluxe.api.php
+54
-0
54 additions, 0 deletions
autocomplete_deluxe.api.php
with
54 additions
and
0 deletions
autocomplete_deluxe.api.php
0 → 100755
+
54
−
0
View file @
d43fb612
<?php
// $Id$
/**
* @file
* This contains documentation only.
*/
/**
* Using the Autocomplete Deluxe element.
*
* When you want to use the Autocomplete Deluxe element, you have to choose
* between two types sources for the suggestion data: Ajax Callbacks or Lists.
* You can set the source type by using the appropriate options:
* - #autocomplete_path expects a string with an url, that points to the ajax
* callback. The response should be encoded as json(like for the core
* autocomplete).
* - #options needs an array in the form of an array(similar to #options in core
* for selects or checkboxes): array('a', 'b', 'c') or array(1 => 'a', 2 =>
* 'b', 3 => 'c').
*
* Besides this two, there are three other options, wich autocomplete deluxe
* accepts:
* - #multiple Indicates whether the user may select more than one item. Expects
* TRUE or FALSE, by default it is set to FALSE.
* - #autocomplete_multiple_delimiter If #multiple is TRUE, then you can use
* this option to set a seperator for multiple values. By default a string
* with the follwing content will be used: ', '.
* - #autocomplete_min_length Indicates how many characters must be entered
* until, the suggesion list can be opened. Especially helpfull, when your
* ajax callback returns only valid suggestion for a minimum characters.
* The default is 0.
*/
function
somefunction
()
{
switch
(
$type
)
{
case
'list'
:
$element
=
array
(
'#type'
=>
'autocomplete_deluxe'
,
'#options'
=>
$options
,
'#multiple'
=>
FALSE
,
'#autocomplete_min_length'
=>
0
,
);
break
;
case
'ajax'
:
$element
=
array
(
'#type'
=>
'autocomplete_deluxe'
,
'#autocomplete_path'
=>
url
(
'some_uri'
,
array
(
'absolute'
=>
TRUE
)),
'#multiple'
=>
TRUE
,
'#autocomplete_min_length'
=>
1
,
'#autocomplete_multiple_delimiter'
=>
'|'
,
);
break
;
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment