Using cascadePanes on large dataset doesn't seem to work with serverSide processing

Using cascadePanes on large dataset doesn't seem to work with serverSide processing

ptaylorptaylor Posts: 28Questions: 7Answers: 0

Over the last couple weeks, I've moved to using Datatables with server-side processing, due to some tables that I needed to display with pretty large quantities of data. It has been working well. I found SeachPanes and saw that it was recently updated to work with server side processing, so I have spent a few hours today working to implement it on one of my pages. The page in question has a bit over 110,000 rows of data, each row with about 25 columns, which join to at least one other table. If I do not have cascadePanes set to true, it works fine with the two columns I've added to SearchPanes. When I turn on cascadePanes, though, the page never seems to finish loading. I hit F12 in Chrome, and it appears to be loading my controller over and over again. The page loads, I get the "Loading Search Panes..." message in that section of the page, the table never loads data (or at least, it hasn't in the few minutes I've given it). I checked the processor utilization, and the processor has gone to 99%, with mysqld over 60%. (This is a dev box, so it's usually doing almost nothing)

Is this an issue on timing, where the browser is trying over and over to load because its' not getting an answer quickly enough?

This question has accepted answers - jump to:

Answers

  • sandysandy Posts: 913Questions: 0Answers: 236

    Hi @ptaylor ,

    Thanks for spotting this, I've replicated it locally and will get straight to finding a fix. I've raised an issue internally (DD-1526 for my reference) and will report back here when there is an update.

    Thanks,
    Sandy

  • sandysandy Posts: 913Questions: 0Answers: 236
    Answer ✓

    Hi @ptaylor ,

    I've identified and fixed the issue. This will be available in the next SearchPanes release which we hope will be soon. Until then you can access the fix from the nightly builds.

    Thanks,
    Sandy

  • ptaylorptaylor Posts: 28Questions: 7Answers: 0

    Thanks!

  • ptaylorptaylor Posts: 28Questions: 7Answers: 0

    I did run into one additional issue with this nightly build. Not a major issue, but it does behave a bit strange. When I have cascadePanes turned on, my first selection on the first pane filters the 2nd pane as expected. All the items are still shown in the first pane. If I then select another item in the 1st pane (switching to a different one, not doing multiple selections), the 1st pane clears out all the other entries so only the most recent select shows up in the pane. If I hit the "X" in the search bar, it resets to showing all items. If I hit an item, then hit the X, hitting the next item works as expected.

  • ptaylorptaylor Posts: 28Questions: 7Answers: 0

    Another question - I thought I saw somewhere that when you change the render in the javascript that it would automatically render the searchPane that way? Perhaps I misunderstood something, but here's some code:

    columns: [
    { data: 'name' },
    { data: 'group' },
    { data: 'support_type',
    render: function ( data, type, row ) {
    if (data == 1) {
    return 'pre-sales';
    } else {
    return 'post-sales';
    }
    }
    }
    ]

    So, in this example, pre-sales is 1, post-sales is 2. I want them sorted that way (so that pre-sales is before post-sales in the list - alphabetically, it would be the opposite), but don't want the numbers rendered. In the tables, this would work, rendering properly and sorting properly. But, in the SearchPane, this will show up as 1 and 2, instead of pre-sales and post-sales.

    Is my mind playing tricks on me? I thought I read somewhere that SearchPanes would take the rendered value from the JS render to display the name in the searchPane instead of the numeric value.

    If it is the case (and I've gotten something confused), how would I go about rendering the name in the searchPane itself?

  • sandysandy Posts: 913Questions: 0Answers: 236
    Answer ✓

    Hi @ptaylor ,

    Thanks for spotting these.

    For your first point that is indeed a bug, the behaviour in that case should be the same as the first click. I've raised an issue internally (DD-1551 for my reference) and will report back here when there is an update.

    Secondly for the rendering function. When working with ServerSide processing it will indeed take the rendered value to display, however when using ServerSide it won't as all of it's processing goes on in the back end. You can however provide SearchPanes with a render function in your controller and achieve the same result.

    For the above case you would want to do something along the lines of the following

    Field::inst( 'users.site' )
        ->searchPaneOptions( SearchPaneOptions::inst()
            ->render( function ( $str ) {
                if ($str == 1) {
                    return "pre-sales";
                }
                else {
                    return "post-sales";
                }
            } )
        );
    

    Thanks,
    Sandy

  • sandysandy Posts: 913Questions: 0Answers: 236

    Hi @ptaylor ,

    That should be the issue fixed now. This will be available in the next SearchPanes release which we hope will be in the next few weeks. Until then you can again access the fix from the nightly builds.

    Thanks,
    Sandy

  • ptaylorptaylor Posts: 28Questions: 7Answers: 0

    Sandy, thanks for the help on the render - that looks good.

    On the bug issue with the 2nd selection, I'm still running into this problem. My first column only has 6 results to filter. If I click any of the 6, it works as expected on the first click. If I then select a different item in the first pane, I see the 2nd and 3rd panes update to show the items associated with the selection in the first pane, but then I see the 1st pane update also to show only the item selected.

    I usually test in Chrome, but after seeing this behavior continue, I tried reloading the page, hitting F5, CTRL F5, but no change. So, I tried it in firefox, a browser I had not used in a while (probably never for this page), to ensure it wasn't still caching the old nightly version I had loaded, and it still performed the same way. So, I think the issue is still there?

  • sandysandy Posts: 913Questions: 0Answers: 236
    Answer ✓

    Hi @ptaylor ,

    Apologies for this, I managed to forget to push after making the change which meant that the nightly didn't update. It should have done that now.

    Again, sorry for this,
    Sandy

  • ptaylorptaylor Posts: 28Questions: 7Answers: 0

    Working great now! Thank you so much.
    Thanks again for the terrific support on a great product!

This discussion has been closed.