1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
| <table class="flexme3" style="display: none"></table>
<script type="text/javascript">
$(function() {
$(".flexme3").flexigrid({
url: 'media/ajax/post-xml.php',
dataType: 'json',
colModel : [
{display: 'ID', name : 'id', width : 40, sortable : true, align: 'left'},
{display: 'Nom', name : 'nom', width : 100, sortable : true, align: 'left'},
{display: 'Prenom', name : 'prenom', width : 100, sortable : true, align: 'left'},
{display: 'Langue', name : 'langue', width : 100, sortable : true, align: 'left'}
],
buttons : [
{name: 'Ajouter', bclass: 'add', onpress : doCommand},
{name: 'Delete', bclass: 'delete', onpress : doCommand},
{separator: true}
],
searchitems : [
{display: 'ID', name : 'id'},
{display: 'Site', name : 'site', isdefault: true},
{display: 'Type', name : 'type'}
],
sortname: "id",
sortorder: "asc",
usepager: true,
title: "Rémuneration",
useRp: true,
rp: 10,
showTableToggleBtn: false,
resizable: false,
width: 800,
height: 200,
singleSelect: true
});
});
function doCommand(com, grid) {
if (com == 'Ajouter') {
$('.trSelected', grid).each(function() {
var id = $(this).attr('id');
id = id.substring(id.lastIndexOf('row')+3);
alert("Ajouter row " + id);
});
}
else if (com == 'Delete') {
$('.trSelected', grid).each(function() {
var id = $(this).attr('id');
id = id.substring(id.lastIndexOf('row')+3);
alert("Delete row " + id);
});
}
}
</script> |