DataTables and ajax


Topic: DataTables and ajax

Mohamed Aboughoufa asked a year ago

I am trying to fill Data table from ajax request with keeping Search controls is this possible ?
'serverSide': true,
'ajax': { 'AccountTbls/Index2?cou=': 500}


Jakub Mandra staff premium commented a year ago

Hello, It's not possible now, they were meant to work with html markup. Regards

RegalarTech pro answered a year ago

So there is no AJAX support in MDB ?

Piotr Glejzer staff answered a year ago

Hello, we support ajax like in normal DataTable. For example, if you want to use basic ajax I have a simple example of this. You need HTML MDB DataTable structure and initiate js code with ajax and JSON file. I created snipets with code and information and I checked that and It's working well.

MarkSmit answered 6 months ago

Hi, I am trying to get MDBootstrap (free version 4.8.1) working with JSON / Ajax, but unsuccessfully so far (HTML embedded data is working and my controller code gets called but there is a javascript error). I cannot download the snippet because it requires MDB Pro (?) Is there any way to try out snippets within the editor? Thanks for any help, Mark.

Piotr Obrebski staff answered 6 months ago

Hi MarkSmit,

Our snippets don't require you to be mdb pro user. You can test whatever you want in our test environment online. However, if you want to download code that requires mdb-pro and compile it locally on your device you need to buy our mdb pro license. You can test mdb free in our snippets and copy code. Run it in your localhost by setting up mdb free.

You can setup mdb free following instructions of this tutorial:

If you need additional help I am here for you.

Best Regards, Piotr

gravey16 pro premium answered 6 months ago

The Following option does not work. It never hits the endpoint to get the data

"ajax": { "url":"", "type":"GET" } 

The only real work around is to do this.


.get('', function(dataset){
        var table = $('#exante').DataTable({
                                    {title:'Nodeid', data:'nodeid'},
                                    {title:'Tick', data:'time'},
                                    {title:'Lmp', data:'lmp'},
                                    {title:'Mcc', data:'mcc'},
                                    {title:'Mlc', data:'mlc'},
                                    {title:'IntLmp', data:'intlmp'},
                                    {title:'IntMcc', data:'intmcc'},
                                    {title:'Delta', data:'delta'},
                                    {title:'DaLmp', data:'dalmp'},
                                    {title:'DaMcc', data:'damcc'}

Hopefully this will get fixed at some point.

Piotr Obrebski staff commented 6 months ago

We will test this usecase.

Please insert min. 20 characters.


Specification of the issue
  • User: Free
  • Premium support: No
  • Technology: jQuery
  • MDB Version: 4.5.10
  • Device: Dell
  • Browser: Chrome
  • OS: Windows 10
  • Provided sample code: No
  • Provided link: No