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
| <?php $a=$this->baseUrl(); ?>
<html>
<head>
<title>Dojo Grid example</title>
<style type="text/css">
@import "<?php echo $a; ?>/js/dojo/dijit/themes/nihilo/nihilo.css";
</style>
<style type="text/css">
@import "<?php echo $a; ?>/js/dojo/dijit/themes/nihilo/nihilo.css";
@import "<?php echo $a; ?>/js/dojo/dojox/grid/resources/nihiloGrid.css";
</style>
<script type="text/javascript" src="<?php echo $a ?>/js/dojo/dojo/dojo.js" djConfig="parseOnLoad:true, isDebug: true"></script>
<script type="text/javascript">
dojo.require("dojox.grid.DataGrid");
dojo.require("dojo.data.ItemFileWriteStore");
</script>
<body class="nihilo">
<span dojoType="dojo.data.ItemFileWriteStore"
jsId="store3" url="records">
<script type="dojo/connect" event="onSet" args="item,attr,oldVal,newVal">
console.debug("About to change "+attr+" from "+oldVal+" to "+newVal);
// Save the record with dojo.xhrPost or your favorite remote method
dojo.xhrPost({
url: 'save',
content: {type: dojo.byId('type') }
});
</script>
</span>
<table dojoType="dojox.grid.DataGrid"
jsId="grid3"
store="store3"
query="{ name: '*' }"
rowsPerPage="20"
clientSort="true"
style="width: 400px; height: 200px;"
rowSelector="20px">
<thead>
<tr>
<th width="200px"
field="id">Id</th>
<th width="200px"
field="name">Country/Continent Name</th>
<th width="auto"
field="type"
editable="true">Type</th>
</tr>
</thead>
</table>
</body>
</html> |