Are you the publisher? Claim or contact us about this channel


Embed this content in your HTML

Search

Report adult content:

click to rate:

Account: (login)

More Channels


Showcase


Channel Catalog


Channel Description:

Recent Discussions — DataTables forums
    0 0

    Hi,
    Im using angular 6 for developping my application.
    i create 3 component with router logic.
    That mean that when navigate one component to others. Html is deleted and generated.
    So on each component i have each other a table that they get initialize in the function ngOnInit.
    Each other have different options and different ajax sources routes.
    Each time i navigate to a component the table make a first request to my backend.
    But some how when i navigate to another component. he keeps the old ajax source data from the old data initialization and pop some alert error msg with error on colomn x to row x and data x. But the table keeps working. But the alert concern colomn data that i initialize in a old datatable options.

    In the ngOnDestroy function i try $('#foo').DataTable().destroy() and $('#foo').DataTable().clear().
    I try this method at the end of ngOnInit to see what happend and the table actually get destroy and data clear but like i said somehow when i navigate that spam me an error about a data that dont exist on another table.

    Is there a way to add on my router logic to clear complety ajax data?

    I hope you guys understand my question, thanks for the help.

    *edit: somehow i cant send exemple code maybe to long and cant use playground


    0 0

    Can someone explain why the second to last line here does not add a class of 'tablecell' to all my <td> elements?

    $(document).ready(function() {
        var table = $('#ratings-table').DataTable({
            "ajax": 'table_senate_info.json',
            "columns": [
                { "data": "ratingPhrase" },
                { "data": "state" },
                { "data": "fullName" },
                { "data": "trump_margin" },
                { "data": "firstName" },
                { "data": "lastName" },
                { "data": "raceRatingID" },
                { "data": "open_seat" }
            ],
            "columnDefs": [
                { targets: [4, 5, 6, 7], visible: false },
                {
                    "targets": 2,
                    "render": function(data, type, row) {
                        return data + ' (' + row.open_seat + ')';
                    }
                },
                { "orderData": 5, "targets": 2 },
                { "orderData": [6, 5], "targets": 0 }
            ],
            renderer: "bootstrap",
            responsive: "true",
        });
        table.$('td').addClass('tablecell');
    });
    

    0 0

    I'm building a Laravel app with AdminLTE integrated in the backend. AdminLTE uses DataTables to generate the tables, this works fine. But in AdminLTE it's only possible to sort columns, and it's not possible to filter columns. In one admin view I want to filter columns with a dropdown as shown in this DataTables example. I've tried to integrate the example code in AdminLTE file main.js. But I haven't got it working. In main.js there is a codesnippet where probably the new code should or could be integrated.

    $('.datatable').each(function () {
        if ($(this).hasClass('dt-select')) {
            window.dtDefaultOptions.select = {
                style: 'multi',
                selector: 'td:first-child'
            };
    
            window.dtDefaultOptions.columnDefs.push({
                orderable: false,
                className: 'select-checkbox',
                targets: 0
            });
        }
        $(this).dataTable(window.dtDefaultOptions);
    
    });
    

    Does anyone have an idea how to get the filtering working?


    0 0
  • 01/17/19--16:13: Regarding alignment issue?
  • Hi @allan ,
    I created a test case regarding the issue for alignment issue.

    Please go through the steps below to replicate the issue:
    --> Run this code in .
    -->Select No1 field try to update it to any name (example ::
    System Architectaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) and click outside of the table.
    --> the header and body alignment came correctly.

    Result in my application:

    -->When i edit any field and insert so many characters (Example::
    System Architectaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) and click outside.
    --> In our case input field is expanding but header is not expanding, we are not using anything extra styles/css. How to resolve this issue.
    --> we are using data table version-

    datatables-1.10.19/js/jquery.dataTables.min.js
    editor-1.8.0/js/dataTables.editor.min.js
    editor-1.8.0/css/editor.bootstrap4.min.css

    Please go through this updated link @allan

    http://live.datatables.net/diyariwa/33/edit

    Thanks,
    Saidulu.


    0 0

    I am using Datatables / Editor for almost a year, and am getting fairly comfortable with it, but I still run into issues on occasion.

    In this case, I'm trying to initialize the pageLength of a table with a value supplied as a user preference. This is not working correctly. The first page is correct per the setting of the user preference, but clicking any of the numbered page buttons, or 'Next' or 'Previous' displays the entire table, although indicator of what should be displaying is correct. If I change the 'pageLength' using the on-screen selector widget, things behave correctly for that setting and paging then works correctly thereafter, for any setting. It is only when trying to use the 'pageLength' passed in from the user's preferences that it fails.

    I retrieve the user preference on the server and embed it in the HTML for the page, and it appears there, correctly. My problem is getting that value into the DataTable definition.

    In my javascript that defines the table, I have the following:

                lengthChange: true,
                 'pageLength':  function() {
                        var itPageLen = $('#itPageLen').attr('data-pagelength');
                        if (itPageLen === 'All') {
                            itPageLen = -1;
                        }
                },
                'lengthMenu':   [[10,25,50,100,-1],[10,25,50,100,'All']],
                'language': {
                    'decimal':  '.',
                    'thousands':    ','
                },
    

    In the HTML, I have the following:

            <div id="itRole" data-itRole="tech"></div>
            <div id="itPageLen" data-pagelength=All></div>
    
    
    

    The program always sets 'data-pagelength' to one of the values in the 'lengthMenu', so there is no mismatch, and no matter which one I use, it always displays the first page correctly and behaves incorrectly in the same way as described above whenever I use any of the paging buttons. I've tried a couple of other ways of initializing 'pageLength', but I always get the same incorrect behavior.

    My use of the similar parameter, 'itRole', which affects other behavior , works correctly, which makes this more puzzling.

    What is a correct way of passing and using this information?

    Thanks in advance,
    Tom


    0 0

    Hi, when I'm trying to upload a file I have an error: "File uploaded to a field that does not have upload options configured". Help me please

    Controller:

    public ActionResult JTovar()
            {
                var request = System.Web.HttpContext.Current.Request;
                var settings = Properties.Settings.Default;
                using (var db = new DataTables.Database(settings.Dbtype, settings.DbConnection))
                {
                    var response = new Editor(db, "Tovar", "id")
                        .Model<ModelTovar>()
                        .Field(new Field("Tovar.id"))   
                                         
                        .MJoin(new MJoin("image")
                                .Link("Tovar.id", "interImage.idTovar")
                                .Link("image.id", "interImage.idImage")
                        .Model<MjoinImageTovar>()
                        .Field(
                           new Field("Tovar.Links")                                     
                               .Upload(
                               new Upload(request.PhysicalApplicationPath + @"uploads\__ID____EXTN__")
                               .Db("image", "id", new Dictionary<string, object>
                               {
                                  {"fileName", Upload.DbType.FileName},
                                  {"fileSize", Upload.DbType.FileSize},
                                  {"webPath", Upload.DbType.WebPath},
                                  {"systemPath", Upload.DbType.SystemPath}
                               })
                               .Validator(Validation.FileSize(50000000, "Max file size is 500000K."))
                               .Validator(Validation.FileExtensions(new[] { "jpg", "png", "gif","html","htm" }, "Please upload an image or html file."))
                                      )
                              .SetFormatter(Format.NullEmpty())
                                )                  
                              )
                        .Process(request)
                        .Data();
                    return Json(response, JsonRequestBehavior.AllowGet);
                }
            }
    
    {
                    label: "Links:",
                    name: "Tovar.Links",
                    type: "uploadMany",
                    display: function (id) {
                        return '<img src="' + editor.file('image', id).webPath + '"/>';
                    },
                    noImageText:'No image'
                }
    ------------------------------------------------------------------------------------------------------
    {
                 data: "Tovar.Links",
                 render: function (data)
                 {
                     console.log(data);
                     return data?             
                          data.length + ' files(s)' :
                           'No file';
                 },
                 title: "Image"
             }
    --------------------------------------------------------------------------------------------------------
    

    Models:

     public class MjoinImageTovar
        {
            public class interImage
            {
                public int id { get; set; }
                public int idTovar { get; set; }
                public int idImage { get; set; }
    
            }
            public class image
            {
                public int id { get; set; }
                public string fileName { get; set; }
                public int fileSize { get; set; }
                public string webPath { get; set; }
                public string systemPath { get; set; }
            }
        }
    
    public class ModelTovar
        {
            public class Tovar
            {
                public int id { get; set; }         
                public string Links { get; set; }
               
            }
    

    Edited by Allan Formatting using markdown.


    0 0

    I'm trying to figure out if this is possible. When a user scrolls up or down the datatable the following is always visible at the head...


    0 0
  • 12/31/18--08:43: Multibyte strlen for Editor
  • Dear all,

    In Editor last version, in Editor/Validate.php, the functions minLen and maxLen use strlen instead of a multibyte version of strlen, thus if using UTF8 the letter with accents count for 2, and validation fails.

    Regards,

    Gilles Boussin


    0 0

    Hello,
    If i were to add a rangle slider , how can i use the inbuilt sort function to make the slider sort the datatables?
    Any help would be appreciated ^^


    0 0

    I have installed and successfully activated the plugin but it is not showing on the WP left hand side bar. I am using not as Localhost but live on internet if that makes sense..... not sure of the correct term as new to WP.

    Any pointers appreciated.


    0 0

    Hello to forum,
    Please, I have big trouble with colReorder with serverSide processing and use stateSave.
    What is the problem?
    If I made the initial load of dataTable by click to fetch Data button it looks OK, The sorting is OK, and the functions which change teh data in the field to anchor work fine and in console I see that it call only one saveState for save the state into DB. When I change the Column position for example id from 1st position to 3rd position after invoice number, it looks OK, but is call the stateSave two times.
    But When I call the fetch Data by the button again, then the column name change position to basic position and the data stay on the new position, Unfortunately the function for change the data to anchor not change the right column, but the column by the column name, not by the column with right data. How it looks? The data with ID are in 3rd column, but the column name ID is on top of 1st column. even I see that loadState is called one time and saveState is called two times.
    OK, So i try to push the button again and the name of column with ID changed the position to 2nd column and the data is still on 3rd. loadState called only one time, saveState called 2 times. When I click on the button fetchData the ID name of column move to 3rd column and function at this time run correctly and change the data to anchor. The loadState called only one time, saveState called two times again.
    Please, can you help me with this? I can to find what I do bad.
    Shall I run the script with debug script with write the resolution into DB?
    Thanks a lot for help
    Honza H


    0 0

    I have an UploadMany that doesn't appear to fire a callback thru AJAX when an item is "Deleted" (X clicked on the right):

                editor = new $.fn.dataTable.Editor(
                    {
                        ajax: { 
                            data: 
                            function(d) {
                                d.DT_RowID = editor.ids();
                            },
                            type: "POST",
                            url: "/AudioClips/Edit"
                        },
                        idSrc: "id",
                        table: "#Table_be6112dc6271436db5230ee7143273b7",
                        fields: [
                            {
                                name: "name",
                                label: "Name"
                            },
                            {
                                name: "clips",
                                label: "Audio Clip",
                                type: "uploadMany",
                                noFileText: "No Clips Uploaded.",
                                display: function (file)
                                {
                                    if(file.fullyQualifiedID)
                                        return '<audio controls src="/AudioClips/Clip/?source=' + file.fullyQualifiedID + '" />';
                                    else
                                        return '<audio controls src="/AudioClips/Clip/?source=' + editor.ids() + '_' + file + '" />';
                                }
                            }
                        ]
                } );
    
                $('#Table_be6112dc6271436db5230ee7143273b7').on('click', 'tbody td.dt-editable', function (e)
                {
                    editor.inline(this);
                } );
    
        var dataTable = $("#Table_be6112dc6271436db5230ee7143273b7").DataTable(
            {
                processing: true,
                serverSide: true,
                filter: true,
                order: [0, 'asc'],
                orderMulti: false,
                ajax: {
                    url: "/AudioClips/Items?id=2dac5d78-3373-47cf-815a-4cd8e9b78c3e",
                    type: "POST",
                    datatype: "json"
                },
                columns: [
                    {
                        className: "dt-editable",
                        data: "name",
                        name: "Name",
                        autoWidth: true
                    },
                    {
                        className: "dt-editable",
                        data: "clips",
                        name: "Audio Clip",
                        render: function (d)
                        {
                            if (d.length)
                            {
                                return "<button class=\"btn btn-sm btn-outline-secondary dt-editable\">" + d.length + " Clips</button>";
                            }
    
                            return  "No Clips Uploaded.";
                        },
                        autoWidth: true,
                    },
                    {
                        data: "hasChildren",
                        name: "Is Variable?",
                        autoWidth: true
                    },
                    {
                        data: "id",
                        orderable: false,
                        render: function (data, type, row, meta)
                        {
                            return '<button class=\"btn btn-sm btn-outline-success Table_be6112dc6271436db5230ee7143273b7-details\">Details</Button>&nbsp;<button class="btn btn-sm btn-outline-danger" onclick="DeleteAudioClip(\''+data+'\');">Delete</button>';
                        }
                    }]
            });
    

    I'm getting not JS errors in Chrome and the break-point for the ajax() call in the editor itself is not being hit. I was curious if it was, perhaps, an issue with losing focus (I know that sometimes things don't update until focus is lost), but the break-point is still never hit and the server doesn't seem to get any calls either (from verbose logging).

    It's fine if I need to tie into a custom parameter or something -- I just need to know what's up.


    0 0

    @kthorngren,

    In his ajax data option example:
    http://live.datatables.net/hopepicu/1/edit

    Does this example work for both client and server-side?
    How is url: "/ajax/arrays.txt" getting the information? Is this snippet tied to a backend somewhere or a separate http: site?

    I see if you comment it out and press refresh the table only shows the data (John Smith).
    Anyway, I am trying to make my webpage use ajax.reload() but have NO idea where to store a link as a .text file. Webhost won't let me save anything as .text.

    Sample project link if needed: https://datatables-ajax.000webhostapp.com/


    0 0

    I would like for newly created rows to be automatically selected. I've tried the following code:

    editor.on('postCreate', function (e, json, data, id) {
                table.row('#' + id).select();
            });
    

    It looks like the data is already in the table at that point, but I can't query out the row yet. Is there another event that I could attach this to?


    0 0

    I have 12 datatables:

        <table id = "TABLE_1" class = "table table-striped"> 
        <table id = "TABLE_2" class = "table table-striped">
    

    I need to display datatables with export and visibility buttons.
    This is the datatables-init.js file

        $(document).ready(function() {
            var table = $("table[id^='TABLE']").DataTable( {
        
                buttons: ['copy', 'excel', 'pdf', 'colvis']
            });
            table.buttons().container()
                .appendTo(table.DataTable()('.col-md-6:eq(0)'));
        } );
    

    The buttons do not display, I know that this is a problem with the place where they are displayed. Can anyone help ?


    0 0

    I'm using Row details to display extra information for each item in my table.

    I see from the source row I can use row.child() to get a reference to the details panel (if it exists) for a given row.

    Is there a way to go backwards? If I have a reference for the details can I get the parent?


    0 0

    Hello,

    I have an problem, I have some amount in blue and bold on html table but on Print Preview option is not showing the same as the html.

    Is a way to do the same as html?

    thanks in advance.


    0 0

    Hi guys, i am having a problem with my datatable on server side ajax source.

    I can retrieve correctly my data from server and display it's on datatable, but when I clicked any page number always I get an autoincrement number page.

    Any ideas?, how can I get current page selected?

    Thanks very much.





    0 0

    "columns": [{
    "data": "seriel"
    }, {
    "data": "sa_id"
    }, {
    "data": "open"
    "render": function(data, type, row, meta){
    if(type === 'display'){
    data = '<a href="User.jsp?date1=' + date1 + '&&date2='+ date2 +'&&status='+ 'Open' +'&&sa_id='+ ..... +'">' + data + '</a>';
    }

                        return data;
                     }
                 }
            ]
    

    0 0

      if (e.keyCode == 40){ //arrow down
                  
                 table.$('tr.selected').removeClass('selected');
                tr.next().addClass('selected');
                tr = table.$('tr.selected');
                  
                }
                if (e.keyCode == 38){ //arrow up
                  
                 table.$('tr.selected').removeClass('selected');
                   tr.prev().addClass('selected');
                   tr = table.$('tr.selected');
                
                }
                data = table.row('tr.selected').data();
    

    0 0

    I have used custom select options drop-down with custom label & value.
    Below is the code for that.

    var userClasses = [
        {
            "label": "Administrator",
            "value": "admin"
        },{
            "label": "Contact",
            "value": "contact"
        },{
            "label": "Readonly",
            "value": "readonly"
        }
    ];
    

    I have also attached the gif to understand.
    just for information: I have used text-transform: capitalize to make the first letter capital.


    0 0

    Hi guys anybody tell me what it is i just paid the 8 pound odd for was it the forum or am i able to use scripts? I'm looking for a database with i can use for a non profit website. I'm looking for a script i can use i had set one up but needed the name field to be hidden so that only admin can see that but all other fields name hidden age male/female, location, and also a text field users can put extra information in. the only field the user can edit is the text field everything else would have to be admin.

    Can anybody point me in the right direction or tell me where i could get this done with a free generater that won't expire

    i must have paid for the forum use then


    0 0

    Hi guys, I am using DataTable Server-Side processing, and I am having problems when data should draw on data table.

    this is my init .

    $(document).ready( function () {
      var tableNomina  = $("#tabla-nomina").DataTable({
                    processing: true,
                    serverSide: true,
                    ajax: {
                        url: "rest/search",
                        contentType: "application/json",
                        type: "POST",
                        data: function ( d ) {
                            var currentPage = 1;
                            
                            if(tableNomina != null){
                                var info = tableNomina.page.info();
                                currentPage = info.page;
                                console.log('currentPage: ' + info.page);
                            }
    
                            var postData = '{';
                            postData += '"nomina": "",';
                            postData += '"usuario": "",';
                            postData += '"fecha": "",';
                            postData += '"monto": "",';
                            postData += '"conceptoNid": -1,';
                            postData += '"origenNid": -1,';
                            postData += '"estadoNid": -1,';
                            postData += '"orderBy": "dfecnomina",';
                            postData += '"orderType": "ASC",';
                            postData += '"paginaActual": ' + currentPage + ',';
                            postData += '"registrosTotales": 1,';
                            postData += '"registrosFiltrados": 1';
                            postData += '}';
    
                            return postData;
                        },
                        dataSrc: 'data',
                        dataFilter: function(data){
                            console.log(data);
                            return data;
                        },error: function(error) {
                             console.log(error);
                        }
                    }
                    ,"columns": [
                        { data: 'nidnomina' },
                        { data: 'sidarchivo' },
                        { data: 'sestado' },
                        { data: 'sidusuarionomina' },
                        { data: 'dfecnomina' },
                        { data: 'nmontototalpagado' },
                        { data: 'sconcepto' },
                        { data: 'sidorigen' },
                        { data: 'nidnomina' }
                    ]
                });
    } );
    

    When I get data from first and last page, this is OK, but when I get data from intermediate pages is the problem, data not render correcty.

    My json returned from server is correctly valid, and containts the same struct from all requests,



    Thanks


    0 0

    Hello Friends,
    Please, I have big trouble with async stateLoadCallback.
    When I use this call the script in section $(document).ready(function () stop correct work.
    I mean this code for call

            "stateLoadCallback" : function(settings, callback){
                $.ajax({
                    url: 'helpari/db_state_load.php?listId=' + $('input[id=listId]').val()
                    , dataType: 'json'
                    , success: function (json) {
                         console.log(json);
                         callback(json);
                    }
                    , error: function () {
                        callback(null);
                        beginner = 1;
                        console.log("Not completed Load stateCallback")
                    }
                });
            },
    

    And here is the code which is prepared in $(document).ready(function () section

    $(document).ready(function () {
            var DataTableBody = $('#dataTable tbody');
            console.log(DataTableBody);
            $('.leftmenutrigger').on('click', function (e) {
                $('.side-nav').toggleClass("open");
                e.preventDefault();
            });
    
      // prepare PDF view
            DataTableBody.on('click', '#PDFMaker', function (){
                var rsp, pathT;
                var data = oTable.row($(this).parents('tr')).data();
                var XMLFile = data['msg_link'];
                var myData = "filename=" + XMLFile;
    
                // Volame PDF maker
                $.ajax({
                    type: "GET",
                    url: "helpari/show_pdf_new.php",
                    dataType: "text",
                    data: myData,
                    success: function (response) {
                        // alert(response);
                        rsp = response.split(":");
                        pathT = "helpari/" + rsp[1] + ".pdf";
                        opendialog(pathT, "PDF náhled");
                    },
                    error: function (xhr, ajaxOptions, thrownError) {
                        alert(thrownError);
                    }
                });
            });
    

    So, but If I user the SYNC call as you can see in the another code, all works Okay, but in the Console I see the error message about synchonized XMLHttpRequest, that it is OLD in the main thread.

            "stateLoadCallback" : function(settings, callback){
                var o;
                $.ajax({
                    url: 'helpari/db_state_load.php?listId=' + $('input[id=listId]').val()
                    , dataType: 'json'
                    , async: false
                    , success: function (json) {
                        o = json;
                    }
                    , error: function () {
                        callback(null);
                        beginner = 1;
                        console.log("Nepovedl se Load stateCallback")
                    }
                });
                return o;
            },
    

    Please, Where is the problem?
    Why doesn't it work correctly with asynchronous call of the loadStateCallback?
    Thanks a lot for help
    Honza H


    0 0

    Hi guys,

    I'm trying to transition my DT to SSP, and it's working great! However, I'm running into a few problems with parts of the code, because I used to rely on the data being fully loaded at the start.

    My search function is posted below and collects data from a form (input and select). It executes after user action.

    What happened with pure JS is that columns would be searched as loaded. With SSP it's a whole different thing.

    • General table.search() does not work at all.
    • Searching in two columns at the same time also doesn't work.
    • Strings that contain text separated by commas are limited to searches within portions between commas
    • I also believe that, as you search, the number of results gets smaller, as if you're searching within your own results.

    My server-side code uses PHP and is copied from your example here.

    What am I doing wrong?

    var searchIt = function () {
    
        var searchUrl = ($('.form-control').val()).replace(/ /g,"+");
        var searchKey = $('.form-control').val();
        var selectedCategory = $('#gosearch').text();
    
        table.columns().search("").draw();)
    
        if (searchKey.length > 0) {
    
          if(selectedCategory == "General") { // Detect keyword search
            table.search(searchKey).draw();
            window.history.pushState({page:""}, document.title, "?=" + searchUrl);
          }
          else if (selectedCategory == "Author") { // Detect authors search
            table.columns(1).search(searchKey).draw();
            window.history.pushState({page: ""}, document.title, "?aut=" + searchUrl);
          }
          else if(selectedCategory == "Publication") { // Detect periodical search
            table.columns([6,7]).search(searchKey).draw();
            window.history.pushState({page: ""}, document.title, "?pub=" + searchUrl);
          }
          else if(selectedCategory == "Keyword") { // Detect keyword search
            table.columns(4).search(searchKey).draw();
            window.history.pushState({page: ""}, document.title, "?tag=" + searchUrl);
          }
          $('.alert').animate({top: "1em"});
          $('.alert').delay(500).animate({top: "-10em"});
        }
        else { // Detect empty search
          table.columns().search("").draw();
          window.history.pushState({page: ""}, document.title, "/");
        }
    
      }
    

    0 0

    I have initialized the table with data. The export excel is working fine. If i make any changes to the table column manually through jquery. The changes are not exporting in excel. It exports the old unmodified data.
    How to export excel report with changes after it got initialized.

    Pls help me out. Thanks in advance


    0 0

    i am using datatable which uses server side pagination on table scroll. So It loads the data as an when I scroll down the table. I want to send api call to the service when i reach the 100th records, next 200 th record and 300th record , so on.

    How to set that limit as 100 ?
    I tried iDisplyLimit : 50.
    But not working.
    Thanks in advance


    0 0

    Can we change cell border color to white or remove cell borders?
    If so, can you pls provide me a code for it


    0 0

    I'm moving to server-side processing. Usually I'd merge JSON fields with javascript after the file was loaded. I can still do that in SSP, but it breaks up search, since search works in the original fields, and not the actual data in the columns.

    To give you an example, I have a column for authors. When there is no author, the output is an editor. When searching, I want to search for people (author/editor), but SSP will only search for one of the two. My solution would be an array merged before the json output, printed to a hidden column, which would be searched.

    Can it be done? This is my php file, copied from your SSP example.

    $columns = array(
    array( 'db' => 'Author', 'dt' => 'authors'),
    array( 'db' => 'Editor', 'dt' => 'editor'),
    array( 'db' => 'Item Type', 'dt' => 'type'),
    array( 'db' => 'Publication Year', 'dt' => 'year' ),
    array( 'db' => 'Title', 'dt' => 'title' ),
    array( 'db' => 'Publication Title', 'dt' => 'pubtitle' ),
    array( 'db' => 'Publisher', 'dt' => 'publisher' ),
    array( 'db' => 'Url', 'dt' => 'url'),
    array( 'db' => 'DOI', 'dt' => 'doi' ),
    array( 'db' => 'Title', 'dt' => 'title' ),
    array( 'db' => 'Reviewed Author', 'dt' => 'reviewed' ),
    array( 'db' => 'Abstract Note', 'dt' => 'abstract' ),
    array( 'db' => 'ISBN', 'dt' => 'isbn' ),
    array( 'db' => 'Tags', 'dt' => 'tags'),
    array( 'db' => 'Place', 'dt' => 'place' ),
    array( 'db' => 'Type', 'dt' => 'genre' ),
    array( 'db' => 'Publisher', 'dt' => 'publisher' ),
    array( 'db' => 'Pages', 'dt' => 'pages' ),
    array( 'db' => 'Volume', 'dt' => 'volume' ),
    array( 'db' => 'Issue', 'dt' => 'issue')
    );

    require( 'ssp.class.php' );

    echo json_encode(
    SSP::simple( $_GET, $sql_details, $table, $primaryKey, $columns)
    );