Author: deepak
Date: Tue Jun 28 18:46:50 2016 New Revision: 1750555 URL: http://svn.apache.org/viewvc?rev=1750555&view=rev Log: (OFBIZ-7350) Applied slightly modified patch jira issue. =========================================== Manage filters in lookup auto completion =========================================== Thanks Charles STELTZLEN for your contribution. Modified: ofbiz/trunk/framework/images/webapp/images/fieldlookup.js ofbiz/trunk/framework/images/webapp/images/selectall.js Modified: ofbiz/trunk/framework/images/webapp/images/fieldlookup.js URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/fieldlookup.js?rev=1750555&r1=1750554&r2=1750555&view=diff ============================================================================== --- ofbiz/trunk/framework/images/webapp/images/fieldlookup.js (original) +++ ofbiz/trunk/framework/images/webapp/images/fieldlookup.js Tue Jun 28 18:46:50 2016 @@ -249,7 +249,7 @@ var Lookup = function(options) { // write the new input box id in the ajaxUrl Array options.ajaxUrl = options.ajaxUrl.replace(options.ajaxUrl.substring(0, options.ajaxUrl.indexOf(",")), _newInputBoxId); new ajaxAutoCompleter(options.ajaxUrl, (options.showDescription == "true") ? true : false, options.defaultMinLength, options.defaultDelay, - options.formName); + options.formName, options.args); } } Modified: ofbiz/trunk/framework/images/webapp/images/selectall.js URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/selectall.js?rev=1750555&r1=1750554&r2=1750555&view=diff ============================================================================== --- ofbiz/trunk/framework/images/webapp/images/selectall.js (original) +++ ofbiz/trunk/framework/images/webapp/images/selectall.js Tue Jun 28 18:46:50 2016 @@ -394,7 +394,10 @@ function ajaxSubmitFormUpdateAreas(form, * form of: areaId, target, target parameters [, areaId, target, target parameters...]. */ -function ajaxAutoCompleter(areaCsvString, showDescription, defaultMinLength, defaultDelay, formName){ +function ajaxAutoCompleter(areaCsvString, showDescription, defaultMinLength, defaultDelay, formName) { + ajaxAutoCompleter(areaCsvString, showDescription, defaultMinLength, defaultDelay, formName, null); +} +function ajaxAutoCompleter(areaCsvString, showDescription, defaultMinLength, defaultDelay, formName, args) { var areaArray = areaCsvString.replace(/&/g, '&').split(","); var numAreas = parseInt(areaArray.length / 3); @@ -414,10 +417,16 @@ function ajaxAutoCompleter(areaCsvString minLength: defaultMinLength, delay: defaultDelay, source: function(request, response){ + var queryArgs = {"term": request.term}; + if (typeof args == "object" && jQuery.isArray(args)) { + for (var i = 0; i < args.length; i++) { + queryArgs["parm" + i] = jQuery(args[i]).val(); + } + } jQuery.ajax({ url: url, type: "post", - data: {term : request.term}, + data: queryArgs, beforeSend: function (jqXHR, settings) { //If LAST_AUTOCOMP_REF is not null means an existing ajax auto-completer request is in progress, so need to abort them to prevent inconsistent behavior of autocompleter if (LAST_AUTOCOMP_REF != null && LAST_AUTOCOMP_REF.readyState != 4) { |
Free forum by Nabble | Edit this page |