[jQuery] setData and extraParams problem

[jQuery] setData and extraParams problem


Hi All,
When I do focus is on the autocompletion textbox, that triggers the
function right below where the autocompletion plugin is initialized ,
which is supposed to add the "&key=value" values to form the remote
url. Based on this remote url I am getting the filtered output, which
will list out in the autocompletion textbox but its not adding
"&key=value". So I am getting all the list. I think the setData is
not setting the extraParams.
help?
For example:
If i select one field in the Html form say product "xyz" and based on
this the release field should 3 values "1.1 | 1.2 | 1.3", but it
displays all the list (almost 300 values). Its because when i select
something in the autocompletion textbox then the url format should be
something like this:
http://mdx.lt.com/xyz/abc/ac-list?q=1.&limit=300&timestamp=1249677100317&fname=release{1}&product=mmm
Instead of the above it is formating as. Here product field is
missing, due to which it displays all the release value.
http://mdx.lt.com/xyz/abc/ac-list?q=1.&limit=300&timestamp=1249677100317&fname=release{1}.
This is my autocomplete call:
$field.autocomplete({
url:ac_url,
cacheLength:1,
matchContains:true,
max:300,
width:'50%',
scrollHeight:320,
minChars:1,
extraParams:{ fname:fieldname },
formatItem: function(data, i, max, value, term) {
// data will be an array of value, description
return '<span class="ui-autocomplete-value">' + value +
'</span><span class="ui-autocomplete-info">' + data[1] + '</
span>';
}
});
$field.autocomplete('result', function() {
$field.change(); // Notify mass edit that the field's value has
changed.
$field.blur(); // Trigger auto-set.
});
});
// Pass along field dependency values to filter auto-completion
list.
$textbox.focus(function() {
var fieldname = this.id.replace(/([{}])/g, '\\$1');
$(this).autocomplete('flushCache');
params = { fname:fieldname };
$(this).autocomplete('setData',
{ extraParams:add_deps
(autocomplete_drilldowns,
fieldname, params) });
});
What is the right way to see what the above function (add_deps) is
returning?
Any help will be greatly appreciated.
Thanks,