SearchBuilder / stateSave: SCRIPT5007: Unable to get property 'topRow' of undefined or null referen

SearchBuilder / stateSave: SCRIPT5007: Unable to get property 'topRow' of undefined or null referen

JLH999JLH999 Posts: 13Questions: 3Answers: 0

Error messages shown:

SCRIPT5007: Unable to get property 'topRow' of undefined or null reference

Description of problem:

When I enable stateSave an error appears for searchBuilder trying to find a property of topRow?

Has anyone encountered this before?

(u.searchBuilder=b._collapseArray(b.getDetails(!0)))});this.s.dt.on("column-reorder",function(){b.rebuild(b.getDetails())});a&&(a=this.s.dt.state.loaded(),null!==a&&void 0!==a.searchBuilder?(this.s.topGroup.rebuild(a.searchBuilder),this.s.topGroup.dom.container.trigger("dtsb-redrawContents"),this.s.dt.page.info().serverSide||(a.page?this.s.dt.page(a.page).draw("page"):this.s.dt.scroller&&this.s.dt.scroller().scrollToRow(a.scroller.topRow)),this.s.topGroup.setListeners()):!1!==this.c.preDefined&&(this.c.preDefined=

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    It's working as expected here. Could you look at that, please, and see if it helps. If it's still not working for you, please can you update my example, or link to your page, so that we can see the problem.

    Cheers,

    Colin

  • mw777edsmw777eds Posts: 3Questions: 0Answers: 0

    I am having a related issue. It isn't stopping it from working but it is throwing this error. Only if I have both stateSave and searchBuilder both active. If I disable either of them then I have no problem.

    http://live.datatables.net/tutazike/1/edit

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    @mw777eds Thanks for that test case, but I'm not seeing that error. Please can you give steps on how to generate it,

    Colin

  • mw777edsmw777eds Posts: 3Questions: 0Answers: 0

    Refresh the page after load. That gives an error on the live.datatables.net. I have also posted the page here so that you can open it normally. Again it loads without error but reloading the page gives the error. I think it is not finding what it needs to restore state.

  • sandysandy Posts: 913Questions: 0Answers: 236

    Hi @mw777eds,

    A fix was pushed for this a couple of weeks ago. It's currently available in the nightly builds. You may need to break the cache by appending ?alsvblaiusbfvla to the end of the url in your script tag. We are hoping to make a SearchBuilder release in thee next few weeks.

    Thanks,
    Sandy

  • mw777edsmw777eds Posts: 3Questions: 0Answers: 0

    Not sure if I am doing this wrong but getting errors including one on CSS, "Unexpected {" and then I believe it isn't finding the javascript. (I have it commented out now because it was breaking things)

        <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.6.0/css/bootstrap.css"/>
        <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.11.5/css/dataTables.bootstrap4.css"/>
        <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/autofill/2.3.7/css/autoFill.bootstrap4.min.css"/>
        <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/buttons/2.2.2/css/buttons.bootstrap4.css"/>
        <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/colreorder/1.5.5/css/colReorder.bootstrap4.css"/>
        <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/datetime/1.1.2/css/dataTables.dateTime.css"/>
        <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/fixedcolumns/4.0.2/css/fixedColumns.bootstrap4.css"/>
        <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/fixedheader/3.2.2/css/fixedHeader.bootstrap4.css"/>
        <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/keytable/2.6.4/css/keyTable.bootstrap4.css"/>
        <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/responsive/2.2.9/css/responsive.bootstrap4.css"/>
        <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/rowgroup/1.1.4/css/rowGroup.bootstrap4.css"/>
        <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/rowreorder/1.2.8/css/rowReorder.bootstrap4.css"/>
        <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/scroller/2.0.5/css/scroller.bootstrap4.css"/>
        <!-- <link rel="stylesheet" type="text/css" href="https://nightly.datatables.net/searchbuilder/css/searchBuilder.dataTables.min.css"/> -->
        <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/searchpanes/2.0.0/css/searchPanes.bootstrap4.css"/>
        <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/select/1.3.4/css/select.bootstrap4.css"/>
        <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/staterestore/1.1.0/css/stateRestore.bootstrap4.css"/>
         
        <script type="text/javascript" src="https://code.jquery.com/jquery-3.6.0.js"></script>
        <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.6.0/js/bootstrap.js"></script>
        <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jszip/2.5.0/jszip.js"></script>
        <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.36/pdfmake.js"></script>
        <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.36/vfs_fonts.js"></script>
        <script type="text/javascript" src="https://cdn.datatables.net/1.11.5/js/jquery.dataTables.js"></script>
        <script type="text/javascript" src="https://cdn.datatables.net/1.11.5/js/dataTables.bootstrap4.js"></script>
        <script type="text/javascript" src="https://cdn.datatables.net/autofill/2.3.7/js/dataTables.autoFill.js"></script>
        <script type="text/javascript" src="https://cdn.datatables.net/autofill/2.3.7/js/autoFill.bootstrap4.js"></script>
        <script type="text/javascript" src="https://cdn.datatables.net/buttons/2.2.2/js/dataTables.buttons.js"></script>
        <script type="text/javascript" src="https://cdn.datatables.net/buttons/2.2.2/js/buttons.bootstrap4.js"></script>
        <script type="text/javascript" src="https://cdn.datatables.net/buttons/2.2.2/js/buttons.colVis.js"></script>
        <script type="text/javascript" src="https://cdn.datatables.net/buttons/2.2.2/js/buttons.html5.js"></script>
        <script type="text/javascript" src="https://cdn.datatables.net/buttons/2.2.2/js/buttons.print.js"></script>
        <script type="text/javascript" src="https://cdn.datatables.net/colreorder/1.5.5/js/dataTables.colReorder.js"></script>
        <script type="text/javascript" src="https://cdn.datatables.net/datetime/1.1.2/js/dataTables.dateTime.js"></script>
        <script type="text/javascript" src="https://cdn.datatables.net/fixedcolumns/4.0.2/js/dataTables.fixedColumns.js"></script>
        <script type="text/javascript" src="https://cdn.datatables.net/fixedheader/3.2.2/js/dataTables.fixedHeader.js"></script>
        <script type="text/javascript" src="https://cdn.datatables.net/keytable/2.6.4/js/dataTables.keyTable.js"></script>
        <script type="text/javascript" src="https://cdn.datatables.net/responsive/2.2.9/js/dataTables.responsive.js"></script>
        <script type="text/javascript" src="https://cdn.datatables.net/responsive/2.2.9/js/responsive.bootstrap4.js"></script>
        <script type="text/javascript" src="https://cdn.datatables.net/rowgroup/1.1.4/js/dataTables.rowGroup.js"></script>
        <script type="text/javascript" src="https://cdn.datatables.net/rowreorder/1.2.8/js/dataTables.rowReorder.js"></script>
        <script type="text/javascript" src="https://cdn.datatables.net/scroller/2.0.5/js/dataTables.scroller.js"></script>
        <!-- <script type="text/javascript" src="https://nightly.datatables.net/searchbuilder/css/searchBuilder.dataTables.min.css"></script>
        <script type="text/javascript" src="https://nightly.datatables.net/searchbuilder/1.3.2/js/searchBuilder.bootstrap4.js"></script> -->
        <script type="text/javascript" src="https://cdn.datatables.net/searchpanes/2.0.0/js/dataTables.searchPanes.js"></script>
        <script type="text/javascript" src="https://cdn.datatables.net/searchpanes/2.0.0/js/searchPanes.bootstrap4.js"></script>
        <script type="text/javascript" src="https://cdn.datatables.net/select/1.3.4/js/dataTables.select.js"></script>
        <script type="text/javascript" src="https://cdn.datatables.net/staterestore/1.1.0/js/dataTables.stateRestore.js"></script>
        <script type="text/javascript" src="https://cdn.datatables.net/staterestore/1.1.0/js/stateRestore.bootstrap4.js"></script>
    
  • allanallan Posts: 63,488Questions: 1Answers: 10,467 Site admin
    edited April 2022
    <!-- <script type="text/javascript" src="https://nightly.datatables.net/searchbuilder/css/searchBuilder.dataTables.min.css"></script>
    

    You've included the CSS in the JS <script> tag there, which will likely be causing most of the issues.

    Allan

Sign In or Register to comment.