0

I want to export the data to excel using jquery jtable, I have tried but I am not getting how to export the data to excel.

I have mentioned the click event in toolbar, inside that click event what are the steps I have to follow please suggest me.

$('#EmpDetResult').jtable({
    title: 'Table of people',
    paging: true,
    toolbar: {
        items: [{
            tooltip: 'Click here to export this table to excel',
            text: 'Export to Excel',
            click: function () {
              "EVENT HERE"
            }
        }]
    },
    actions: {
        listAction: 'getResult.php?formName=afscpEmp&action=test',
        updateAction:'getResult.php?formName=afscpEmp&action=test',
        deleteAction:'getResult.php?formName=afscpEmp&action=test'
    }
});

1 Answer 1

1
toolbar: {
    items: [{
        Tooltip: 'Click here to export this table to excel',
        //icon: '/images/paginate.gif',
        text: 'Export to Excel',
        click: function () {
            window.location = 'getResult.php?formName=afscpEmp&action=export-excel';
            e.preventDefault();
        }
    }]
},
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.