forked from DNNCommunity/DNN.Blog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TermsEditML.ascx
43 lines (34 loc) · 1.25 KB
/
TermsEditML.ascx
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
<%@ Control Language="vb" AutoEventWireup="false" CodeBehind="TermsEditML.ascx.vb" Inherits="DotNetNuke.Modules.Blog.TermsEditML" %>
<div id="termtable"></div>
<p style="width:100%;text-align:center">
<asp:LinkButton runat="server" ID="cmdCancel" resourcekey="cmdCancel" CssClass="dnnSecondaryAction" />
<asp:LinkButton runat="server" ID="cmdUpdate" resourcekey="cmdUpdate" CssClass="dnnPrimaryAction" />
</p>
<asp:HiddenField runat="server" ID="Storage" />
<script type="text/javascript">
(function ($, Sys) {
$(document).ready(function () {
$("#termtable").handsontable({
rowHeaders: false,
colHeaders: true,
contextMenu: false,
colHeaders: <%=ColumnHeaders%>,
columns: <%=Columns%>,
onChange: function (change, source) {
$('#<%=Storage.ClientID%>').val(JSON.stringify(handsontable.getData()))
},
onBeforeChange: function (data) {
for (var i = data.length - 1; i >= 0; i--) {
if(data[i][1]=='DefaultName' && data[i][3]=='') {
data[i][3]=data[i][2];
}
}
}
});
var handsontable = $("#termtable").data('handsontable');
blogService.getVocabularyML(<%=VocabularyId%>, function (res) {
handsontable.loadData(res);
})
});
} (jQuery, window.Sys));
</script>