Keep the current value iin the search form when reloading the search form for a different (sub)class. For example Contact => Person.

SVN:trunk[1725]
This commit is contained in:
Denis Flaven
2011-12-19 17:27:24 +00:00
parent 123f5c4cf5
commit 321e7dc309

View File

@@ -119,8 +119,18 @@ function ReloadSearchForm(divId, sClassName, sBaseClass, sContext)
}
sAction = $('#ds_'+divId+' form').attr('action');
$.post(GetAbsoluteUrlAppRoot()+'pages/ajax.render.php?'+sContext,
{ operation: 'search_form', className: sClassName, baseClass: sBaseClass, currentId: divId, action: sAction },
// Save the current values in the form
var oMap = {};
$('#ds_'+divId+" form :input[name!='']").each(function() {
oMap[this.name] = this.value;
});
oMap.operation = 'search_form';
oMap.className = sClassName;
oMap.baseClass = sBaseClass;
oMap.currentId = divId;
oMap.action = sAction;
$.post(GetAbsoluteUrlAppRoot()+'pages/ajax.render.php?'+sContext, oMap,
function(data) {
oDiv.empty();
oDiv.append(data);