Commit 78f133e6 authored by Tristan Cavelier's avatar Tristan Cavelier Committed by Sebastien Robin

Improving spreadsheet in officeJS.

parent 4cbc1904
...@@ -61,11 +61,14 @@ ...@@ -61,11 +61,14 @@
<!-- <!--
$(function(){ $(function(){
//Here is where we initiate the sheets //Here is where we initiate the sheets
//every time sheet is created it creates a new jQuery.sheet.instance (array), to manipulate each sheet, the jQuery object is returned //every time sheet is created it creates a new jQuery.sheet.instance
$('#jQuerySheet0').sheet({ //(array), to manipulate each sheet, the jQuery object is returned
$('#jQuerySheet').sheet({
title: '', title: '',
inlineMenu: inlineMenu($.sheet.instance), inlineMenu: inlineMenu($.sheet.instance),
urlGet: 'component/newspreadsheet.html', urlGet: 'component/newspreadsheet.html',
// buildSheet: true,
editable: true,
autoFiller: true autoFiller: true
}); });
...@@ -202,14 +205,40 @@ function goToObj(s){ ...@@ -202,14 +205,40 @@ function goToObj(s){
</style> </style>
</head> </head>
<body> <body>
<div id="jQuerySheet0" class="jQuerySheet" style="height: 450px;"> <div>
<input type="text"
name="fileName"
id="input_fileName"
value=""
placeholder="File name here" />&nbsp;
<button type="submit"
class="btn btn-primary"
onclick="OfficeJS.save($('#input_fileName').attr('value'));">
<i class="icon-download-alt icon-white"></i>
Save
</button>&nbsp;
<button type="submit"
class="btn"
onclick="OfficeJS.load($('#input_fileName').attr('value'));">
<i class="icon-upload"></i>
Load
</button>&nbsp;
<button type="submit"
class="btn btn-danger"
onclick="OfficeJS.remove($('#input_fileName').attr('value'));">
<i class="icon-remove icon-white"></i>
Remove
</button>
</div>
<div id="jQuerySheet" class="jQuerySheet" style="height: 450px;">
</div> </div>
<span id="inlineMenu" style="display: none;"> <span id="inlineMenu" style="display: none;">
<span> <span>
<a href="#" <a href="#"
onclick="sheetInstance.controlFactory.addRow(); return false;" onclick="sheetInstance.controlFactory.addRow(); return false;"
title="Insert Row After Selected"> title="Insert Row After Selected">
<img alt="Insert Row After Selected" src="lib/jquery.sheet/images/sheet_row_add.png"/> <img alt="Insert Row After Selected"
src="lib/jquery.sheet/images/sheet_row_add.png"/>
</a> </a>
<a href="#" <a href="#"
onclick="sheetInstance.controlFactory.addRow(null, true); onclick="sheetInstance.controlFactory.addRow(null, true);
...@@ -234,7 +263,8 @@ function goToObj(s){ ...@@ -234,7 +263,8 @@ function goToObj(s){
<a href="#" <a href="#"
onclick="sheetInstance.deleteRow(); return false;" onclick="sheetInstance.deleteRow(); return false;"
title="Delete Row"> title="Delete Row">
<img alt="Delete Row" src="lib/jquery.sheet/images/sheet_row_delete.png"/> <img alt="Delete Row"
src="lib/jquery.sheet/images/sheet_row_delete.png"/>
</a> </a>
<a href="#" <a href="#"
onclick="sheetInstance.controlFactory.addColumn(); return false;" onclick="sheetInstance.controlFactory.addColumn(); return false;"
...@@ -276,11 +306,12 @@ function goToObj(s){ ...@@ -276,11 +306,12 @@ function goToObj(s){
title="Get Cell Range"> title="Get Cell Range">
<img alt="Get Cell Range" src="lib/jquery.sheet/images/sheet_get_range.png"/> <img alt="Get Cell Range" src="lib/jquery.sheet/images/sheet_get_range.png"/>
</a> </a>
<a href="#" <!-- <a href="#" -->
onclick="sheetInstance.s.fnSave(); <!-- onclick="sheetInstance.s.fnSave(); -->
return false;" <!-- return false;" -->
title="Save Sheets"> <!-- title="Save Sheets"> -->
<img alt="Save Sheet" src="lib/jquery.sheet/images/disk.png"/></a> <!-- <img alt="Save Sheet" src="lib/jquery.sheet/images/disk.png"/> -->
<!-- </a> -->
<a href="#" <a href="#"
onclick="sheetInstance.deleteSheet(); return false;" onclick="sheetInstance.deleteSheet(); return false;"
title="Delete Current Sheet"> title="Delete Current Sheet">
......
...@@ -5,11 +5,11 @@ ...@@ -5,11 +5,11 @@
</label> </label>
<div class="controls docs-input-sizes"> <div class="controls docs-input-sizes">
<input class="input-xlarge" <input class="input-xlarge"
value="{&quot;type&quot;:&quot;local&quot;,&quot;userName&quot;:&quot;tristan&quot;}"
type="text" name="JSONstorage" id="input_json_storage" type="text" name="JSONstorage" id="input_json_storage"
value="{&quot;type&quot;:&quot;local&quot;,&quot;userName&quot;:&quot;tristan&quot;}"
placeholder="storage" /> placeholder="storage" />
<!-- value="{&quot;type&quot;:&quot;replicate&quot;,&quot;storageArray&quot;:[{&quot;type&quot;:&quot;local&quot;,&quot;userName&quot;:&quot;tristan&quot;},{&quot;type&quot;:&quot;dav&quot;,&quot;userName&quot;:&quot;tristan&quot;,&quot;password&quot;:&quot;mdp&quot;,&quot;location&quot;:&quot;http://localhost:80&quot;}]}" --> <!-- value="{&quot;type&quot;:&quot;dav&quot;,&quot;userName&quot;:&quot;tristan&quot;,&quot;password&quot;:&quot;mdp&quot;,&quot;location&quot;:&quot;http://localhost:80&quot;}" -->
<!-- value="{&quot;type&quot;:&quot;dav&quot;,&quot;userName&quot;:&quot;tristan&quot;,&quot;password&quot;:&quot;mdp&quot;,&quot;location&quot;:&quot;http://localhost:80&quot;}" --> <!-- value="{&quot;type&quot;:&quot;replicate&quot;,&quot;storageArray&quot;:[{&quot;type&quot;:&quot;local&quot;,&quot;userName&quot;:&quot;tristan&quot;},{&quot;type&quot;:&quot;dav&quot;,&quot;userName&quot;:&quot;tristan&quot;,&quot;password&quot;:&quot;mdp&quot;,&quot;location&quot;:&quot;http://localhost:80&quot;}]}" -->
</div> </div>
<label class="control-label" <label class="control-label"
for="JSONapplicantID"> for="JSONapplicantID">
......
...@@ -76,7 +76,22 @@ ...@@ -76,7 +76,22 @@
'jquery-sheet': { 'jquery-sheet': {
type:'editor', type:'editor',
path:'component/jquery-sheet.html', path:'component/jquery-sheet.html',
gadgetid:'page-content' gadgetid:'page-content',
getContent: function () {
return JSON.stringify (
$.sheet.instance[0].exportSheet.json()
);
},
setContent: function (content) {
$('#jQuerySheet').sheet({
title: '',
inlineMenu: inlineMenu($.sheet.instance),
buildSheet: $.sheet.makeTable.json(
JSON.parse(content)
),
autoFiller: true
});
}
}, },
'svg-edit': { 'svg-edit': {
type:'editor', type:'editor',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment