This topic contains 1 reply, has 2 voices, and was last updated by Sean Sean 3 years ago.

how to stop jQuery DataTables notification from automatically scrolling


  • brian15co
    Participant

    Posts: 19
    Member Reply #1037

    I am using server-side processing for some DataTables. When the request completes, a custom_action_message is displayed near the top of the table. This feature is nice, but I would like to disable it some places

    For instance, I have included a datatable within a portlet midway down a page, and the auto-scrolling behavior causes the page to scroll down to the message on page load.

    How do I override this behavior only on certain tables? I am using the structure that ships with Metronic, meaning I have a datatables.js file in /static/assets/global/scripts/datatables.js and I create the actual datatable within the javascript specific to each page as in the examples like below
    var grid = new Datatable();

    grid.init({
    src: $(“#parts_table”),
    onSuccess: function (grid) {
    etc…
    }
    etc…

     

    • This topic was modified 3 years ago by  brian15co.
    Sean
    Sean
    Keymaster

    Posts: 4444
    Support Staff Reply #1060

    Hi :),

    Thanks for your feedback on this.

    At the moment this is not configurable yet. We should consider it in a future updates.

    However in the main time you can modify assets/global/scripts/datatable.js script by adding focus: false parameter to all Metronic.alert({}) calls.

    If you need any further assistance please let us know.

    Thanks.

You must be logged in to reply to this topic.