CodeWarrior
CodeWarrior

Reputation: 783

How to add custom button which opens popup for doing task in jTable jquery plugin

I am trying to use jTable jquery plugin for showing gridview like control in my asp.net mvc 4 web page. I am new to using jTable and want to use it for CRUD operation also want to create another custom button which opens popup with some form fields which do some task. I go through jTable documentation and find that we can display custom HTML using it's "display" function but how do I show popup containing fields that I want and send AJAX request(as there are only 4 actions show in documentation).

Is there any way to do this?

Thanks in advance...

Upvotes: 2

Views: 1248

Answers (1)

Harry Sarshogh
Harry Sarshogh

Reputation: 2197

Try this in JSON properties itself :

CustomAction: {
    title: '',
    width: '1%',
    sorting: false,
    create: false,
    edit: false,
    list: true,
    display: function (data) {
        if (data.record) {
            return '<button title="Edit Record" class="jtable-command-button jtable-edit-command-button" onclick="alert(' + data.record.TicketId + '); return false;"><span>Edit Record</span></button>';
        }
    }
}

Upvotes: 1

Related Questions