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
| var store = null;
function ButtonClean(grid, rowIndex) {
//return '<button onclick="javascript:window.location.href =\'<?= $this->baseUrl ?>/asynchronous/cleanrapport/nameLibelle/<?= $this->data['nameLibelle'] ?>/numero/<?= $this->data['clusterId'] ?>/groupe/<?=$this->data['familly'] ?>\';">Clean</button>';
return '<button onclick="alert('+grid+'.store.getValue('+grid+'.getItem('+rowIndex+'), "Number"));">Clean</button>';
}
function ButtonFormat(value, rowIndex){
//<? $valeurphp = "<script language='Javascript'> document.write(rowIndex); </script>"; ?>
return '<img width="30" height="30" src="<?= $this->baseUrl ?>/images/icon-<?= $this->data['fileType'][0] ?>-bleu-ok.gif"/>';
}
function formatMyDate(value, rowIndex) {
return dojo.date.locale.format(value, {datePattern:"dd/MM/yyyy", selector:"date"});
}
var typeMap = {
"Date": {
type: Date,
deserialize: function(value){
var date = new Date(value);
return date;
}
}
};
var gridLayout = [
{ name: "Number", field: "number", width: "auto" },
{ name: "Format", formatter: ButtonFormat, width: "auto" },
{ name: "date_factA_begin", field: "date_factA_begin", formatter: formatMyDate, width: "auto" },
{ name: "date_factA_end", field: "date_factA_end", formatter: formatMyDate, width: "auto" },
{ name: "agence", field: "agence", width: "auto" },
{ name: "date generation", field: "date generation", width: "auto" },
{ name: "Action", formatter: ButtonClean , width: "auto" }
];
dojo.addOnLoad(function() {
store = new dojo.data.ItemFileReadStore({
typeMap : typeMap,
url:"<?= $this->baseUrl().'/asynchronous/teststat/nameLibelle/'.$this->data['nameLibelle'] ?>",
method:"post"
});
grid.setStore(store);
grid.setStructure(gridLayout);
grid.adaptHeight(); |
Partager