Re: FA WITH AUTOCOMPLETE DOWNLOAD

@pswamis

Hi,

you can download the changed files from here

Download files

its updated to latest version 2.4.6

thanks for using this

ANOOP
Experience is the name everyone gives to their mistakes!

Re: FA WITH AUTOCOMPLETE DOWNLOAD

@anoopmb can you mention the changes you made in the core. Overwriting my files with your files will overwrite some of my modifications too.

Thanks in Advance

www.boxygen.pk

28 (edited by anoopmb 12/27/2018 07:28:22 am)

Re: FA WITH AUTOCOMPLETE DOWNLOAD

@boxygen

please use a file compare utility.


i changed ui_lists.inc and auto_select_box.inc

changed $auto_select_box to $SysPrefs->auto_select_box

ANOOP
Experience is the name everyone gives to their mistakes!

Re: FA WITH AUTOCOMPLETE DOWNLOAD

@boxygen - you can use a software named ", Meld" ,it's available for Linux, windows and OS x. Can see the file differences if you compare the files with default core. You can get difference from it . Hope it helps you

Subscription service based on FA
HRM CRM POS batch Themes

Re: FA WITH AUTOCOMPLETE DOWNLOAD

@anoopmb - I have tested your auto complete.  Its working well. You have done a  great job. There is one suggestion from my side.
When It comes with large list of options in select. Like more than 1000 items in the list. It will freeze the system for a while and will go on.

So if possible rewrite it to perform Ajax call and get results from server. By default you can show 20, items in the list. Rest should not be added to the list. When user start typing the related items should show here.

Subscription service based on FA
HRM CRM POS batch Themes

Re: FA WITH AUTOCOMPLETE DOWNLOAD

@ kvvaradha

yeah we can try that  as the popup search type is available now  in combo input function.

let me take a look

thanks for testing

ANOOP
Experience is the name everyone gives to their mistakes!

Re: FA WITH AUTOCOMPLETE DOWNLOAD

I'm also eagerly waiting for this smile
Thanks u so much in advance Anoop, you are doing awesome work smile

anoopmb wrote:

@ kvvaradha

yeah we can try that  as the popup search type is available now  in combo input function.

let me take a look

thanks for testing

Re: FA WITH AUTOCOMPLETE DOWNLOAD

The lists need special character handling so that names like "A & L" Foods appear properly.  One possible fix is to call

function decodeHtml(html) {
    var txt = document.createElement("textarea");
    txt.innerHTML = html;
    return txt.value;
}

where the code currently uses "selval" and

selectedoption.innerHTML= selectedoption.innerHTML.replace(/ /gi,' ');

which currently may not be doing anything because the browser just converts back.

Another minor problem is lost focus because FA does not expect to focus on a hidden variable, which in the new code has the old list name (the new list being named "name" + mselect).  I have a simple fix for this if you are interested.

Thanks for the contribution.  I already had autocomplete lists running on my site but I like yours better because it modular and non-invasive, so I replaced my code with yours.

Re: FA WITH AUTOCOMPLETE DOWNLOAD

@Braath Waate

yeah, please do your contribution so everyone can get benefit of it
thanks for notifying these issues

ANOOP
Experience is the name everyone gives to their mistakes!

Re: FA WITH AUTOCOMPLETE DOWNLOAD

Code fixes for special characters and lost focus

Re: FA WITH AUTOCOMPLETE DOWNLOAD

thanks Braath and i will upadate the code shortly with your changes

ANOOP
Experience is the name everyone gives to their mistakes!

Re: FA WITH AUTOCOMPLETE DOWNLOAD

@anoopmb
If any value with & is selected in the dropdown, after clicking on it the selected value turns into &
so i have changed the typer.value = selectedoption.innerHTML; to typer.value = selectedoption.innerText;
in the following:

selectedoption.innerHTML = selectedoption.innerHTML.replace(/ /gi, ' ');
    typer.setAttribute("value", selectedoption.innerHTML);
    // typer.value = selectedoption.innerHTML;
    typer.value = selectedoption.innerText;
    var hidden = document.createElement('INPUT');


I also added the following regex in the typer.onblur
                + selval = selval.replace(/&/gi, '&');

here is the updated code:
    typer.onblur = function (event) {

        if (optgropc != 1) {
            pop("none");
            optgropc = 0;
            if (typer.value == null || typer.value == '' || typer.value != selectedoption.innerHTML) {
                var selval = selectedoption.innerHTML;
                + selval = selval.replace(/&/gi, '&');
                selval = selval.replace(/\<u\>/ig, '');
                selval = selval.replace(/\<\/u\>/ig, '');
                selval = selval.replace(/ /gi, ' ');
                typer.value = selval;
                hidden.value = selectedvalue;