This is my html table
Code: Select all
<div id="tblremote" style="width:70%; margin-left:auto; margin-right:auto; padding-top:15px">
</div>
Code: Select all
$('#tblremote').puidatatable({
caption: 'Employees',
paginator: {
rows: 15
},
columns: [
{field:'name', headerText: 'name', sortable:true},
{field:'surname', headerText: 'surname', sortable:true},
{field:'address', headerText: 'address', sortable:true},
{field:'email', headerText: 'email', sortable:true}
],
datasource: function load(callback) {
$.ajax({
type: "GET",
url: '...',
dataType: "json",
context: this,
success: function(response) {
callback.call(this, response);
}
});
},
selectionMode: 'multiple',
rowSelect: function(event, data) {
$('#dlg').puidialog('show');
document.getElementById("name").innerHTML = data.name;
document.getElementById("surname").innerHTML = data.surname;
document.getElementById("address").innerHTML = data.address;
},
rowUnselect: function(event, data) {
$('#messages').puigrowl('show', [{severity:'info', summary: 'Row Unselected', detail: (data.name + ' ' + data.surname)}]);
}
});
$('#dlg').puidialog({
showEffect : 'fade',
hideEffect : 'fade',
width : 300,
modal : true,
location : 'center',
buttons : [ {
text : 'Submit',
icon : 'ui-icon-check',
click : function()
{
$('#dlg').puidialog('hide');
$.ajax({
type: "POST",
url: url,
context: this,
success: function() {
=(((((((((((((
}
});
}
}, {
text : 'Cancel',
icon : 'ui-icon-close',
click : function()
{
$('#dlg').puidialog('hide');
}
} ]
});