10842 Posts in 2512 Topics by 1792 members
|Go to End|
16 June 2009 at 7:07pm
I was working on a suggestion form field, I was discussing about this at the google group too, Anyway I'd like to extend the module, and make it a useful plug in.
I am attaching the module here, if you can help me with testing and can give me more ideas that will be great.
17 June 2009 at 1:29am
Looks good. Haven't used it, but a couple things come to mind:
- You're requiring the user to custom code his own suggestion() AJAX call for every instance of the form field. This may work for users who have really specific functionality, but for most of us, we're going to want that to work out of the box, without any custom coding. It seems to me, you could make it more modular, and add a SuggestionField_Controller class that contains a generic suggestion() function for the AJAX call. You could even assume that the two fields you're looking for are Title and Link, and the user could override those in the constructor.
- You should use MATCH and AGAINST instead of LIKE.
- To get the $URL variable, you can save yourself a lot of trouble and use $('base').attr('href');
$J = jQuery.noConflict(); $J('#my-element').hide();
Very nice, though. This is a great idea.
17 June 2009 at 1:55am
thanks for your comments, actually some nice ideas.
This does need some custom coding, but yet it has some features, it can call to any server using CURL or anything, all you have to do is that return the results in a JSON object. other than that some comments I got was running it through SilverStripe can be slow, so if someone can code up his own php code to run outside then you can have that either.
Also about the setting an interval can be useful.
And on the first post I forgot to mention the demo URL for this.
Here it is
|Go to Top|