⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Search autocomplete (like Google Instant)?



Georgee
  • profile picture
  • Member

Posted 26 November 2013 - 08:39 AM

Hello,

 

Grocery CRUD looks great!

congratulations to the developer and the community all!

 

how can I implement autocomplete/suggestion in the search form?

like google instant.

 

google-autocomplete.gif


Amit Shah
  • profile picture
  • Member

Posted 28 November 2013 - 10:15 AM

Hi Georgee

 

Welcome to GC Forums

That surely can be achieved with some tweek in the code

 

Steps for the following:

1 - if you interested to provide the autocomplete stuff all across the crud applications - then you can alter the respective gc theme (for ex: flexigrid). Else will recommend that you make alterations and provision for the same inside the view you load the GC output.

2 - http://jqueryui.com/autocomplete/#multiple-remote - this will share you as how you can achieve the auotocomplete functionality @client side.

You can extract the script - and create a JS file somewhere in the project ... say (assets/scripts/autocomplete.js) .. the same u need to add it to the crud using $crud->set_js(assets/scripts/autocomplete.js) ... or if you altering just in view - u can set the same in view itself.

Mind it - you dont use the jquery on ready ... rather you can write the code inside window.onload = function() { ..... } as this will be the first file included in the js list and here by the time the code gets executed - the jquery is not loaded at all.

3 - Server side - u need to code up the same for data retrieval.

 

Hope the solution works out for you. Any further assistance - will be happy to help you.

 

Happy GCing :)