BUGFIX: autocomplete field should works on all config sub_item of a SecurityAdmin (merged from branches/2.3-nzct)

MINOR: the autocomplete field AjaxMemberLookup? should be only applied to the defined input field with has "text" class. This is for performance imporovement (merged from branches/2.3-nzct)


git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@82092 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2009-07-17 02:23:57 +00:00
parent 901c49c328
commit 5d4ae0dde1
2 changed files with 3 additions and 3 deletions

View File

@ -94,7 +94,7 @@ class SecurityAdmin extends LeftAndMain implements PermissionProvider {
$result = '';
// Make sure we only autocomplete on keys that actually exist, and that we don't autocomplete on password
if(!array_key_exists($fieldName, singleton($this->stat('subitem_class'))->stat('db')) || $fieldName == 'Password') return;
if(!singleton($this->stat('subitem_class'))->hasDatabaseField($fieldName) || $fieldName == 'Password') return;
$matches = DataObject::get($this->stat('subitem_class'),"\"$fieldName\" LIKE '" . Convert::raw2sql($fieldVal) . "%'");
if($matches) {

View File

@ -275,5 +275,5 @@ MemberFilterButton.prototype = {
// has to be external from initialize() because otherwise request will double on each reload - WTF
Behaviour.register({
'#Form_EditForm div.MemberTableField table.data input' : AjaxMemberLookup
'#Form_EditForm div.MemberTableField table.data input.text' : AjaxMemberLookup
});