Improved implementation of the 'autocomplete' input and fix of quite a few related issue with aysnchronous inputs. Autocompletes are now restricted to external keys only.

Some details:
- Autocomplete now matches on 'contains' instead of 'begins with'
- The minimum size of this match is configurable in the config file and per attribute ('min_autocomplete_chars').
- The maximum size that turns a drop-down list into an autocomplete is configurable in the config-file and per attribute ('max_combo_length').
- Better feedback when expanding/collapsing search results lists.
- 'Pointer' cursor on the link to Expand/Collapse results lists.
- The 'mandatory' state of an attribute is no longer lost when some part of a form is reloaded asynchronously

SVN:trunk[947]
This commit is contained in:
Denis Flaven
2010-11-18 16:41:09 +00:00
parent 5ea71a3d51
commit dc9a52c9e0
16 changed files with 621 additions and 124 deletions

View File

@@ -51,25 +51,23 @@ abstract class ValueSetDefinition
}
public function GetValues($aArgs, $sBeginsWith = '')
public function GetValues($aArgs, $sContains = '')
{
if (!$this->m_bIsLoaded)
{
$this->LoadValues($aArgs);
$this->m_bIsLoaded = true;
}
if (strlen($sBeginsWith) == 0)
if (strlen($sContains) == 0)
{
$aRet = $this->m_aValues;
}
else
{
$iCheckedLen = strlen($sBeginsWith);
$sBeginsWith = strtolower($sBeginsWith);
$aRet = array();
foreach ($this->m_aValues as $sKey=>$sValue)
{
if (strtolower(substr($sValue, 0, $iCheckedLen)) == $sBeginsWith)
if (stripos($sValue, $sContains) !== false)
{
$aRet[$sKey] = $sValue;
}