1 (edited by anoopmb 12/27/2018 03:52:05 am)

Topic: FA WITH AUTOCOMPLETE DOWNLOAD

Hi,

##Updated for  fa 2.4.6

Everyone  I am back with another FA Modification that is Autocomplete Select Box.

The script is in pure JavaScript with Zero dependency.

You can enable or disable it on config file at end of the page($auto_select_box=true or false)

You can search by category also

consider as My contribution to FA

please give feed backs

Also  may be you can make my script more great, smile looking forward to it



DOWNLOAD

to read about the list of files changed and details read my blog click more info

MORE INFO

Updated

Fixed some bugs and overflow problems
Also read how to incorporate Auto-Complete Box into a excisting FA in my Updated Blog.

ANOOP
Experience is the name everyone gives to their mistakes!

Re: FA WITH AUTOCOMPLETE DOWNLOAD

Looks great. I'll try it.

Thanks.

Re: FA WITH AUTOCOMPLETE DOWNLOAD

Working fine. Thanks

I have made edits before to let search in customer list to search in addresses also
Now it can't, I believe it will not search in full client name & tax.
is there is any solution for this edit to search by ajax in db for defined fields

Re: FA WITH AUTOCOMPLETE DOWNLOAD

it will search the entered text  in loaded options only.

some bugs fixed and updated.

ANOOP
Experience is the name everyone gives to their mistakes!

Re: FA WITH AUTOCOMPLETE DOWNLOAD

your modification is very useful!

Thank you anoopmb,

Re: FA WITH AUTOCOMPLETE DOWNLOAD

Hi, I made a little modification to your Javascript like following. This modification will allow us to search string that contains the Regex special characters.

if (typer.value != '' && typer.value != null) {
    var pattern = escapeRegExp(typer.value); // Escape some Regex special character.
    var tes = new RegExp('(' + pattern + ')', "i");
    pop('block', tes);

}

I also add this new function to do the escaping process.

function escapeRegExp(str) {
  return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
}

Re: FA WITH AUTOCOMPLETE DOWNLOAD

thanks for your contribution

ANOOP
Experience is the name everyone gives to their mistakes!

Re: FA WITH AUTOCOMPLETE DOWNLOAD

Dear anoopmb,

This is an awsome modification to FA. It has totally changed the shape of it.

One problem that I am facing is that once an item filtered and then selected then using TAB key the next focus is lost. It is not shifting to the next text box on the page.

Regards.

www.boxygen.pk

Re: FA WITH AUTOCOMPLETE DOWNLOAD

Thank you and about TAB key I will check it later but soon. Currently I am little busy with another development.

ANOOP
Experience is the name everyone gives to their mistakes!

Re: FA WITH AUTOCOMPLETE DOWNLOAD

Dear Anoop
I found that after implementing this Auto Complete Feature the Editable Description on Quotation/Direct Sales Invoice is not working now.
Can you please look into it. The editable description feature is very important for our business. Now we are in a fix what to do?

www.boxygen.pk

Re: FA WITH AUTOCOMPLETE DOWNLOAD

yeah i will check and update it shortly and thank you for your information

ANOOP
Experience is the name everyone gives to their mistakes!

12 (edited by bogeyman2007 05/15/2016 07:14:13 am)

Re: FA WITH AUTOCOMPLETE DOWNLOAD

I really like this modification and I'm using it in my development. Few days ago I try to fix the problem related to TAB and lost focus I made the following modifications.

typer.onfocus = function (event) {
    # pop("block"); // I remove this.
    // Then add this line so the textfield will not lost focus if Enter is pressed.
    save_focus(typer);
    typer.select();
};

And also this one.

// I add the 9 (Tab) and 16 (Shift) so the popup list will not be displayed if tab or shift is pressed.
if(event.which!=13&&event.which!=16&&event.which!=17&&event.which!=18&&event.which!=19&&event.which!=20
    &&event.which!=27&&event.which!=35&&event.which!=36&&event.which!=37&&event.which!=38
    &&event.which!=39&&event.which!=40&&event.which!=91&&event.which!=93&&event.which!=224
    &&event.which!=16&&event.which!=9){

After that modification, the autocomplete textfield will not lose the focus when I press Enter and I can safely press Tab to move to cursor to another element.

But one issue still remains in item list that has the textfield for typing item code. In the previous traditional select, when we type the item code, the selected item in list will be changed too based on the code we type. But that's not happen now.

Anoop, I think you can consider to put this modification to GitHub so the people can contribute easier for the development smile.


Thank you

Re: FA WITH AUTOCOMPLETE DOWNLOAD

thank you very much and i will add this to github with your modifications

ANOOP
Experience is the name everyone gives to their mistakes!

Re: FA WITH AUTOCOMPLETE DOWNLOAD

Anoop earlier I wrote that the Editable Description is not working with this modification. But later I could find that If I select the same Item twice then it allows to Edit the Description.

www.boxygen.pk

Re: FA WITH AUTOCOMPLETE DOWNLOAD

link not working ....can u share it again

Re: FA WITH AUTOCOMPLETE DOWNLOAD

I have the modification in the following link:
http://stuff.w3shaman.com/others/fa-autocomplete.zip

Please, remember to backup your code before using it.

Re: FA WITH AUTOCOMPLETE DOWNLOAD

How to make it work on version 2.4 bogey ?

Phuong

Re: FA WITH AUTOCOMPLETE DOWNLOAD

Can anyone help with this Auto Complete in 2.4?

www.boxygen.pk

Re: FA WITH AUTOCOMPLETE DOWNLOAD

hey boxygen,

what help you need?

ANOOP
Experience is the name everyone gives to their mistakes!

Re: FA WITH AUTOCOMPLETE DOWNLOAD

I am using your auto complete in 2.3.25

Please suggest any changes to make it usable in 2.4 as well

www.boxygen.pk

Re: FA WITH AUTOCOMPLETE DOWNLOAD

Any help expected @anoopmb?

www.boxygen.pk

Re: FA WITH AUTOCOMPLETE DOWNLOAD

Can i have a copy of these mod please

Re: FA WITH AUTOCOMPLETE DOWNLOAD

In Post 16 bogeyman has given the link to download

http://stuff.w3shaman.com/others/fa-autocomplete.zip

www.boxygen.pk

Re: FA WITH AUTOCOMPLETE DOWNLOAD

Hi Anoop,
I'm using Front Account v2.4.6 and I'm completely new to this..
I was trying to apply your solution for autocomplete dropdown, but its not working, can you please help me here, it's a very urgent requirement for me..
Thanks in advance.

25 (edited by Braath Waate 12/27/2018 01:06:32 am)

Re: FA WITH AUTOCOMPLETE DOWNLOAD

To make this work with v2.4.6:
add in the auto_select_box lines in ui_lists.inc and auto_select_box.inc but change them to @$SysPrefs->auto_select_box and define the global SysPrefs.  Then add in the MBCODE block in js/inserts.js and the escapeRegExp (late adder) outside the MBCODE block and the call to mbselect in the 'select' block.  Add the MBCODE block in the desired theme.