Skip to content

edenreich/turbo-datatables-response

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Node Datatables

Server-side response generator in the correct format for datatables.

Installation

Inside the vue project run:

npm i turbo-datatables-response

Quickstart

    // Optionally you can give the Datatables the mysql connection.
    const datatables = await Datatables();
    
    // Set the inputs from the client.
    datatables.setInputs(inputs);

    // supply the table name and the columns you need. 
    datatables.of('users').only(['id', 'name', 'email']);
    
    // or use the inverse
    // dt.of('users').hide(['password']);

    // Edit rows values on the fly.
    datatables.edit('name', (row) => {
        return 'Test '+row.name;
    });

    // Generates the response.
    let response = await datatables.make();

    // after the promise has been resolved
    // you will get a json object to return to the client.

Todo

  • Allow to modify rows values.
  • Allow to modify columns labels.

About

Server-side response generator in the correct format for datatables

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published