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
|
<span dojoType="dojo.data.ItemFileWriteStore" jsId="store3" url="http://www.dojotoolkit.org/reference-guide/_static/dojo/dijit/tests/_data/countries.json">
</span>
<script language='javascript'>
function valeur(item){
return isNaN(item) ? item : item;
}
function chargement(){
var layout = [{
field: 'name',
name: 'Pays/Continent',
width: '100px'
},{
field:'type',
name: 'Type',
width:'80px',
type : dojox.grid.cells.Select,
editable : true,
options : ["country","city","continent"],
values : ["1","2","3"],
formatter : function(item){
if(!isNaN(item)){
for(valeur in this.values){
if(this.values[valeur] == item){
maValeur = this.options[valeur];
}
}
}
return isNaN(item) ? item : maValeur;
}
}];
var tableau = new dojox.grid.DataGrid({
id : 'monTableau',
store : store3,
structure : layout,
rowSelector : '20px',
autoWidth : true,
query:'{}',
clientSort : true
},
document.createElement('div'));
dojo.byId("tableauRes").appendChild(tableau.domNode);
tableau.startup();
}
</script>
<div id='tableauRes' style='width:700px;height:700px'></div> |
Partager