1

I'm attempting (so far unsuccessfully) to create an input field in my plugin that has autocomplete functionality.

Looking at the available options I discarded using jquery.UI since the autocomplete functionality was introduced in version 1.8 and looks like Fogbugz is using version 1.7 of this. I couldn't get both of them working at the same time.

Alternatively I tried to find an autocomplete library which would work with the version of jquery that Fogbugz is using (1.3.2). I found one here and tried modifying this example plugin to replace the dropdown with an autocomplete textbox, however I'm not yet able to get it working. It's hard to troubleshoot since there are no errors on the javascript console. I'm afraid the problem might be related to overlapping namespaces but I haven't yet figured it out.

Is there an example available of such a thing working in a plugin?

Any suggestions on what autocomplete plugins would be compatible with Fogbugz?

flag

2 Answers

2

If you want an ajax-roundtripping autocompleting droplist, you want to replicate the behavior of a FogBugz function called DlgAjaxTextBox, unfortunately not yet exposed to plugins. You can find it in src-Website/dlg.was, and what it does is pretty simple, because the DropListControl (which does all of the hard work) is already in place.

It just creates an input with an id and a special attribute called 'pgSrc' which is the 'pg' to call to get the list of possibilities given what has already been typed in the text box, then creates a little script tag with

DropListControl.refresh(elById('[THE ID OF THE INPUT]');

You may run into a problem, which is that you will need to provide an additional argument to the ajax call (your ixPlugin or sPlugin) so you will probably need to use Javascript to patch DropListControl.sendLookupRequest to add an additional optional 'ixPlugin' argument to its 'data' array.

link|flag
I think you missed a brace there. :-) – Michel de Ruiter Apr 6 2011 at 20:13
Thanks! This looks promising. I'll give it a try. So, if I understand this correctly, no need to handle the server-side ajax via IPluginRawPageDisplay. And pgSrc would just be one a function in my plugin that returns an array. Do I need to prefix this function in some way or is it enough to add ixPlugin to the data array in sendLookupRequest and have it be forwarded to my plugin automagically? – Roman Apr 6 2011 at 20:14
1

It's not really "supported" per se, but you could leverage some of the functionality provided by droplist.js that FogBugz uses itself for autocomplete-type fields.

There are some details in this question, and the Notify plugin also provides an example of using DropList for an auto-complete-style field.

link|flag
Thanks! Looking into this option now. – Roman Apr 4 2011 at 17:59

Your Answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.