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
|
JsonStore = new dojo.data.ItemFileWriteStore({ url: "temp/"+utilisateur+"tarifAch0.json", urlPreventCache: "true"});
monGrid = new dojox.grid.DataGrid({
id: 'grid',
query: { TARAREF: '*' },
store: JsonStore,
rowsPerPage: 20,
structure: layout,
region: 'center',
columnReordering: true
}, document.createElement('div'));
function suppSelLignes() {
var monGrid = dijit.byId("grid");
var lignes = monGrid.selection.getSelected();
if (lignes.length >0) {
var reponse = confirm("Vous vous apprêtez à supprimer "+lignes.length+" lignes ?");
if (reponse){
dojo.forEach(lignes, function(selectedItem) {
if (selectedItem !== null) {
JsonStore.deleteItem(selectedItem);
JsonStore.save({onError: function () {alert("error");}});
}
})
monGrid.selection.deselectAll();
}
}else{
alert("Aucune sélection trouvée !!");
}
} |
Partager