mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-04 14:44:26 +08:00
Add formulas to steps tables
This commit is contained in:
parent
5c88bdeeae
commit
3b364be70b
2 changed files with 41 additions and 25 deletions
|
@ -291,6 +291,7 @@ function initHandsOnTable(root) {
|
|||
rowHeaders: true,
|
||||
colHeaders: true,
|
||||
fillHandle: false,
|
||||
formulas: true,
|
||||
cells: function (row, col, prop) {
|
||||
var cellProperties = {};
|
||||
|
||||
|
@ -338,6 +339,7 @@ function initEditableHandsOnTable(root) {
|
|||
rowHeaders: true,
|
||||
colHeaders: true,
|
||||
contextMenu: true,
|
||||
formulas: true,
|
||||
preventOverflow: 'horizontal'
|
||||
});
|
||||
|
||||
|
@ -627,6 +629,15 @@ function expandStep(step) {
|
|||
});
|
||||
}
|
||||
|
||||
function renderTable(table) {
|
||||
$(table).handsontable("render");
|
||||
// Yet another dirty hack to solve HandsOnTable problems
|
||||
if (parseInt($(table).css("height"), 10) < parseInt($(table).css("max-height"), 10) - 30) {
|
||||
$(table).find(".ht_master .wtHolder").css("height", "100%");
|
||||
}
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
// On init
|
||||
initCallBacks();
|
||||
initHandsOnTable($(document));
|
||||
|
@ -650,11 +661,4 @@ $(function () {
|
|||
|
||||
$("[data-action='expand-steps']").click(expandAllSteps);
|
||||
});
|
||||
|
||||
function renderTable(table) {
|
||||
$(table).handsontable("render");
|
||||
// Yet another dirty hack to solve HandsOnTable problems
|
||||
if (parseInt($(table).css("height"), 10) < parseInt($(table).css("max-height"), 10) - 30) {
|
||||
$(table).find(".ht_master .wtHolder").css("height", "100%");
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
|
@ -31,3 +31,15 @@
|
|||
<% end %>
|
||||
|
||||
<%= javascript_include_tag "protocols/steps" %>
|
||||
|
||||
<!-- Libraries for formulas -->
|
||||
<%= javascript_include_tag "lodash" %>
|
||||
<%= javascript_include_tag "numeral" %>
|
||||
<%= javascript_include_tag "numeric" %>
|
||||
<%= javascript_include_tag "md5" %>
|
||||
<%= javascript_include_tag "jstat" %>
|
||||
<%= javascript_include_tag "formula" %>
|
||||
<%= javascript_include_tag "parser" %>
|
||||
<%= javascript_include_tag "ruleJS" %>
|
||||
<%= javascript_include_tag "handsontable.formula" %>
|
||||
<%= stylesheet_link_tag "handsontable.formula" %>
|
||||
|
|
Loading…
Reference in a new issue