Commits

Anonymous committed 730a3c4

modified hAutoComplete to post JSON instead.

  • Participants
  • Parent commits 6f96e68
  • Branches custom_tooltip

Comments (0)

Files changed (1)

File TestWebsite/Scripts/hAutoComplete/hAutoComplete.js

                 surpressErrors = true;
             }
 
-            $.AjaxManager.GET({
+            $.AjaxManager.POSTJson({
                 name: that.attr('name'),
                 message: 'Filtering',
                 url: options.source,
                 single: false,
                 surpressIfError: surpressErrors,
                 dataFunc: function() {
-                    return {
-                        //pass in the term, control ID
+                    var dataPackage = {
                         term: searchObject.term,
                         controlId: that.attr('id')
                     };
+                    $.extend(dataPackage, searchObject.extraParameters);
+                    return dataPackage;
                 },
                 success: function(json) {
                     response(json);
         a public function and lets user to programatically pre-fill
         our autocomplete text input box.
         */
-        $.fn.hAutoComplete.val = function(val) {
-            getFilterResultsFromServer({ term: val }, function(result) {
+        $.fn.hAutoComplete.val = function(inputOptions) {
+            var msg, options;
+
+            options = {
+                term: '',
+                extraParameters: {}
+            };
+
+            $.extend(options, inputOptions);
+            if (options.term.length <= 0) {
+                msg = "term needs to be defined for options in hAutocomplete.val() function";
+                throw msg; alert(msg);
+            }
+            getFilterResultsFromServer(options, function(result) {
                 if (result.length > 0) {
-                    that.data("uiItem", val);
-                    that.val(val);
+                    that.data("uiItem", options.term);
+                    that.val(options.term);
                 }
             }, false);
         };