mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-06 23:15:34 +08:00
Debbuging preive hot tables
This commit is contained in:
parent
2413dc251a
commit
c291caaae3
1 changed files with 24 additions and 2 deletions
|
@ -64,10 +64,32 @@
|
||||||
<%= sanitize_input(json_object['link'].html_safe) %><br>
|
<%= sanitize_input(json_object['link'].html_safe) %><br>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% tables, garbage = protocolsio_string_to_table_element(prot_info_string) %>
|
<% tables, garbage = protocolsio_string_to_table_element(prot_info_string) %>
|
||||||
|
<% table_count = 0 %>
|
||||||
<% tables.each do |index, table| %>
|
<% tables.each do |index, table| %>
|
||||||
<% table_hash = JSON.parse(Base64.decode64(table['contents'])) %>
|
<% table_hash = JSON.parse(Base64.decode64(table['contents'])) %>
|
||||||
<% byebug %>
|
<% pio_table_id = "pio_table_prot_info_"+table_count.to_s %>
|
||||||
<hot-table datarows="{{ <%= table_hash['data'] %> }}"></hot-table>
|
<%# byebug %>
|
||||||
|
<div id="<%=pio_table_id%>" >
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript" charset="utf-8">
|
||||||
|
|
||||||
|
var target = document.getElementById('<%= j pio_table_id%>');
|
||||||
|
var hot = new Handsontable(target, {
|
||||||
|
data: [["", "Ford", "Tesla", "Toyota", "Honda"],["2017", 10, 11, 12, 13],["2018", 20, 11, 14, 13],["2019", 30, 15, 12, 13]],
|
||||||
|
startRows: <%= Constants::HANDSONTABLE_INIT_ROWS_CNT %>,
|
||||||
|
startCols: <%= Constants::HANDSONTABLE_INIT_COLS_CNT %>,
|
||||||
|
rowHeaders: true,
|
||||||
|
colHeaders: true,
|
||||||
|
fillHandle: false,
|
||||||
|
formulas: true,
|
||||||
|
readOnly: true,
|
||||||
|
renderAllRows: true
|
||||||
|
});
|
||||||
|
hot.loadData([["", "Ford", "Tesla", "Toyota", "Honda"],["2017", 10, 11, 12, 13]]);
|
||||||
|
hot.render();
|
||||||
|
|
||||||
|
</script>
|
||||||
|
<% table_count += 1 %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue