2007-07-19 12:40:05 +02:00
|
|
|
MemberTableFieldPopupForm = Class.extend("ComplexTableFieldPopupForm");
|
|
|
|
MemberTableFieldPopupForm.prototype = {
|
|
|
|
initialize: function() {
|
|
|
|
this.ComplexTableFieldPopupForm.initialize();
|
2007-09-15 22:11:40 +02:00
|
|
|
|
2007-07-19 12:40:05 +02:00
|
|
|
Behaviour.register({
|
|
|
|
"form#MemberTableField_Popup_DetailForm input.action": {
|
|
|
|
onclick: this.submitForm.bind(this)
|
|
|
|
},
|
2007-09-15 22:11:40 +02:00
|
|
|
|
2007-07-19 12:40:05 +02:00
|
|
|
'form#MemberTableField_Popup_DetailForm input' : {
|
|
|
|
initialise : function() {
|
|
|
|
if(this.name == 'FirstName' || this.name == 'Surname' || this.name == 'Email') {
|
|
|
|
var div = document.createElement('div');
|
|
|
|
div.id = this.id + '_ac';
|
|
|
|
div.className = 'autocomplete';
|
|
|
|
this.parentNode.appendChild(div);
|
|
|
|
/*
|
|
|
|
new Ajax.Autocompleter(this.id, div.id, 'admin/security/autocomplete/' + this.name, {
|
|
|
|
afterUpdateElement : this.afterAutocomplete.bind(this)
|
|
|
|
});
|
|
|
|
*/
|
|
|
|
}
|
|
|
|
},
|
|
|
|
afterAutocomplete : function(field, selectedItem) {
|
|
|
|
var data = selectedItem.getElementsByTagName('span')[1].innerHTML;
|
|
|
|
var items = data.split(",");
|
2007-09-15 22:11:40 +02:00
|
|
|
|
2007-07-19 12:40:05 +02:00
|
|
|
this.elements.FirstName.value = items[0];
|
|
|
|
this.elements.Surname.value = items[1];
|
|
|
|
this.elements.Email.value = items[2];
|
|
|
|
this.elements.Password.value = items[3];
|
2007-09-15 22:11:40 +02:00
|
|
|
}
|
2007-07-19 12:40:05 +02:00
|
|
|
}
|
2007-09-15 22:11:40 +02:00
|
|
|
|
2007-07-19 12:40:05 +02:00
|
|
|
//'form#MemberTableField_Popup_DetailForm input' : AjaxMemberLookup
|
|
|
|
});
|
2007-09-15 22:11:40 +02:00
|
|
|
}
|
2007-07-19 12:40:05 +02:00
|
|
|
}
|
2007-09-15 22:11:40 +02:00
|
|
|
|
2007-07-19 12:40:05 +02:00
|
|
|
MemberTableFieldPopupForm.applyTo('form#MemberTableField_Popup_DetailForm');
|