Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $('#jqList').jqGrid({
- url: fullBaseUrl+'/candidats/doublons_ws.json',
- datatype: 'json',
- colNames:['ID', 'Nom', 'Prénom', 'Date de naissance', 'Nb doublons'],
- colModel:[
- {name:'id',index:'id', hidden:true},
- {name:'nom',index:'nom', width:200},
- {name:'prenom', index:'prenom', width:200},
- {name:'date_naissance', index:'date_naissance', width:200, formatter: 'date', formatoptions: {
- srcformat: 'Y-m-d',
- newformat: 'd/m/Y'
- }},
- {name:'nbr_doublon',index:'nbr_doublon', width:100}
- ],
- pager: '#jqPager',
- rowNum: 20,
- rowList: [10, 20, 30, 50],
- height: '100%',
- autowidth: true,
- shrinkToFit: true,
- viewrecords: true,
- ignoreCase: true,
- loadonce: true,
- jsonReader: {
- repeatitems: false,
- id: 'id',
- root: 'rows',
- subgrid: {
- repeatitems: false,
- id: 'id',
- root: 'rows',
- }
- },
- subGrid: true,
- subGridUrl: fullBaseUrl+'/candidats/doublons_sub_ws.json',
- subGridModel: [{
- name: ['ID', 'Nom', 'Prénom'],
- width: [50, 100, 100],
- params: ['nom', 'prenom', 'date_naissance'],
- mapping: ['id', 'nom', 'prenom']
- }],
- });
- $('#jqList').jqGrid('navGrid','#jqPager',{edit:false,add:false,del:false});
- $('#jqList').jqGrid('filterToolbar',{stringResult: true, searchOnEnter: false});
- $('#jqList').jqGrid('navButtonAdd', '#jqPager', {
- caption: '',
- title: 'Afficher la barre de recherche rapide',
- buttonicon: 'ui-icon-pin-s',
- onClickButton: function () {
- this.toggleToolbar();
- if ($.isFunction(this.p._complete)) {
- if ($('.ui-search-toolbar', this.grid.hDiv).is(':visible')) {
- $('.ui-search-toolbar', this.grid.fhDiv).show();
- } else {
- $('.ui-search-toolbar', this.grid.fhDiv).hide();
- }
- this.p._complete.call(this);
- fixPositionsOfFrozenDivs.call(this);
- }
- }
- });
- $('#jqList')[0].toggleToolbar();
- function actionFormatter(cellValue, options) {
- var icons = '';
- icons += '<a href="'+fullBaseUrl+'/candidats/doublon_delete/'+options.rowId+'" title="Supprimer" onclick="return confirm(\'Etes-vous sûr de vouloir supprimer ce doublon ?\');"><span class="ui-icon ui-icon-trash"></span></a>';
- return icons;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement