Refactoring fieldlookup.js - step one: restructuring the lookup object, encapsulate some methods in objects
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1352804 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -652,23 +652,41 @@ Parameter: lastViewName, String, optional - If the ajaxEnabled parameter is true
|
||||
</#if>
|
||||
</#if>
|
||||
</#if>
|
||||
<script type="text/javascript">
|
||||
<script type="text/javascript">
|
||||
jQuery(document).ready(function(){
|
||||
new ConstructLookup("${fieldFormName}", "${id}", document.${formName?html}.${name?html}, <#if descriptionFieldName?has_content>document.${formName?html}.${descriptionFieldName}<#else>null</#if>, "${formName?html}", "${width}", "${height}", "${position}", "${fadeBackground}", <#if ajaxEnabled?has_content && ajaxEnabled>"${ajaxUrl}", ${showDescription}<#else>"", false</#if>, "${presentation!}", "${defaultMinLength!2}", "${defaultDelay!300}"<#rt/>
|
||||
<#if targetParameterIter?has_content>
|
||||
<#assign isFirst = true>
|
||||
<#lt/>, [<#rt/>
|
||||
<#list targetParameterIter as item>
|
||||
<#if isFirst>
|
||||
<#lt/>document.${formName}.${item}<#rt/>
|
||||
<#assign isFirst = false>
|
||||
<#else>
|
||||
<#lt/> ,document.${formName}.${item}<#rt/>
|
||||
</#if>
|
||||
</#list>
|
||||
<#lt/>]<#rt/>
|
||||
</#if>
|
||||
<#lt/>);
|
||||
var options = {
|
||||
requestUrl : "${fieldFormName}",
|
||||
inputFieldId : "${id}",
|
||||
dialogTarget : document.${formName?html}.${name?html},
|
||||
dialogOptionalTarget : <#if descriptionFieldName?has_content>document.${formName?html}.${descriptionFieldName}<#else>null</#if>,
|
||||
formName : "${formName?html}",
|
||||
width : "${width}",
|
||||
height : "${height}",
|
||||
position : "${position}",
|
||||
modal : "${fadeBackground}",
|
||||
ajaxUrl : <#if ajaxEnabled?has_content && ajaxEnabled>"${ajaxUrl}"<#else>""</#if>,
|
||||
showDescription : <#if ajaxEnabled?has_content && ajaxEnabled>"${showDescription}"<#else>false</#if>,
|
||||
presentation : "${presentation!}",
|
||||
defaultMinLength : "${defaultMinLength!2}",
|
||||
defaultDelay : "${defaultDelay!300}",
|
||||
args : <#rt/>
|
||||
<#if targetParameterIter?has_content>
|
||||
<#assign isFirst = true>
|
||||
<#lt/>, [<#rt/>
|
||||
<#list targetParameterIter as item>
|
||||
<#if isFirst>
|
||||
<#lt/>document.${formName}.${item}<#rt/>
|
||||
<#assign isFirst = false>
|
||||
<#else>
|
||||
<#lt/> ,document.${formName}.${item}<#rt/>
|
||||
</#if>
|
||||
</#list>
|
||||
<#lt/>]<#rt/>
|
||||
<#else>[]
|
||||
</#if>
|
||||
<#lt/>
|
||||
};
|
||||
new Lookup(options).init();
|
||||
});
|
||||
</script>
|
||||
</#if>
|
||||
|
||||
Reference in New Issue
Block a user