What do you mean by "Using a dev like we did for product should be the solution" using ajax_autocompleter ?

Florian HENRY
florian.he...@open-concept.pro
+33 6 03 76 48 07
http://www.open-concept.pro
Twitter : @_Open_Concept_
Secretaire de l'association Dolibarr

Le 30/10/2013 11:25, Destailleur Laurent a écrit :
Yes, the combobox is an easy way to have autocompletion without developing ajax pages but it must be restricted to limited list. So for contacts it is not a good choice. Using a dev like we did for product should be the solution.

Waiting for that, did you try with chrome ? For such problem, it is really faster than firefox



2013/10/30 Florian Henry <florian.he...@open-concept.pro <mailto:florian.he...@open-concept.pro>>

    Hi all,

        I'm experenting a real performance issue with jquery comobox
    (thridparty and contact)
        I've a data base with more than 20 000 contact, if I click on
    the arrow to display all contact, firefox freeze and put me a
    message "too long execution script continue or stop". I can
    continue but this is really bad user experience. I try to find a
    solution over internet.

    For the search engine I found a piece of code and update
    core/lib/lib_head.js.
        In _create: function() {
            replace

     var matcher = new RegExp(
    $.ui.autocomplete.escapeRegex(request.term), "i" );
                             /response( select.children(
    "option:enabled" ).map(function() {
                                var text = $( this ).text();
                                if ( this.value && ( !request.term ||
    matcher.test(text) ) )
                                    return {
                                        label: text.replace(
                                            new RegExp(
    "(?![^&;]+;)(?!<[^<>]*)(" +
    $.ui.autocomplete.escapeRegex(request.term) +
    ")(?![^<>]*>)(?![^&;]+;)", "gi"
                                            ), "<strong>$1</strong>" ),
                                        value: text,
                                        option: this
                                    };
                            }) );

    By

                            var matcher = new RegExp(
    $.ui.autocomplete.escapeRegex(request.term), "i" );
                            var select_el = select.get(0); // get dom
    element
                            var rep = new Array(); // response array
                            // simple loop for the options
                            for (var i = 0; i < select_el.length; i++) {
                                var text = select_el.options[i].text;
                                if ( select_el.options[i].value && (
    !request.term || matcher.test(text) ) )
                                    // add element to result array
                                    rep.push({
                                        label: text.replace(
                                            new RegExp(
    "(?![^&;]+;)(?!<[^<>]*)(" +
    $.ui.autocomplete.escapeRegex(request.term) +
    ")(?![^<>]*>)(?![^&;]+;)", "gi"
                                            ), "<strong>$1</strong>" ),
                                        value: text,
                                        option: select_el.options[i]
                                    });
                            }
                            // send response
                            response( rep );

    It improve perf to 20% on render search. But the problem of down
    arrow click is still here.

    Here my question :

        1-At this time it's mostly a client side issue, but do you
    already experience this type of issue ? How did you solve it ?

-- Florian HENRY
    florian.he...@open-concept.pro <mailto:florian.he...@open-concept.pro>
    +33 6 03 76 48 07 <tel:%2B33%206%2003%2076%2048%2007>
    http://www.open-concept.pro
    Twitter : @_Open_Concept_
    Secretaire de l'association Dolibarr


    _______________________________________________
    Dolibarr-dev mailing list
    Dolibarr-dev@nongnu.org <mailto:Dolibarr-dev@nongnu.org>
    https://lists.nongnu.org/mailman/listinfo/dolibarr-dev




_______________________________________________
Dolibarr-dev mailing list
Dolibarr-dev@nongnu.org
https://lists.nongnu.org/mailman/listinfo/dolibarr-dev

_______________________________________________
Dolibarr-dev mailing list
Dolibarr-dev@nongnu.org
https://lists.nongnu.org/mailman/listinfo/dolibarr-dev

Répondre à