Author Topic: Search Data using textbox from table - very slow  (Read 672 times)

developer1

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 44
    • View Profile
Search Data using textbox from table - very slow
« on: May 04, 2022, 05:42:07 pm »
Sometime table going to blank when I'm writing the text for searchbox very fast,

i have used below code for search functionality,
====================================
toolbar: {
                    cls: "pq-toolbar-schedule",
                    items: [
                        {
                            type: 'textbox',
                            //label: 'Filter: ',
                            attr: 'placeholder="Type here your search keyword..."',
                            cls: "filterValue searchBox scheduleSearchField",
                            listener: { timeout: filterhandler }
                        }
                    ]
                }
================================

function filterhandler() {

    var $toolbar = this.toolbar(),
        $value = $toolbar.find(".filterValue"),
        value = $value.val(),
        //condition = $toolbar.find(".filterCondition").val(),
        //dataIndx = $toolbar.find(".filterColumn").val(),
        filterRules;

    filterRules = this.getColModel().map(function (column) {
        return { dataIndx: column.dataIndx, condition: "contain", value: value };
    })

    //call to grid filter method.
    this.filter({
        oper: 'replace',
        rules: filterRules
    });
}

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Search Data using textbox from table - very slow
« Reply #1 on: May 04, 2022, 06:03:50 pm »
Local filtering is quite fast even for 90,000 cells: https://paramquery.com/pro/demos/pivot

Could you please share a jsfiddle.

developer1

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 44
    • View Profile
Re: Search Data using textbox from table - very slow
« Reply #2 on: May 05, 2022, 12:24:21 pm »
Hi Paramvir,

Demo link : https://jsfiddle.net/kfjdheLa/1/

Search words like "chang" or tofu"

You can check the result, its just only 50 rows and take a time for searching process after click

When we search the data more than 6000 rows at that time search results gone off frequently not every time.



paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Search Data using textbox from table - very slow
« Reply #3 on: May 05, 2022, 01:26:29 pm »
That's too fast to notice the lag, so I've created another test with around 75,500 cells as a reference point.

https://jsfiddle.net/qsjr4fkp/

It takes less than 1 second in Chrome and around 2 seconds in Edge for filtering with 75,500 cells.

How much time does it take for you to filter w.r.t 75,500 cells.

Please quantify.
« Last Edit: May 05, 2022, 01:32:49 pm by paramvir »

developer2

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Search Data using textbox from table - very slow
« Reply #4 on: May 06, 2022, 07:50:35 pm »
We have used same code but still facing the same issue

Could you arrange remote support for the same?

So we can easily identify the issue which we are facing.


paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Search Data using textbox from table - very slow
« Reply #5 on: May 06, 2022, 09:56:27 pm »
Please check this jsfiddle having 75,500 cells: https://jsfiddle.net/qsjr4fkp/ and share the exact time taken in seconds by text box filtering in various browsers.

How may cells do you have in your grid ( rows * columns )

Have you used any 3rd party libraries in the same document. If yes then try to run your example in isolated web page.

PS: Remote support is outside the scope of support.