table-view.js
1.08 KB
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
var tt_id;
function template_form_init() {
"use strict";
$('#template-edit-form').find('select[multiple]').multiSelect({
minWidth: 120
});
}
function load_template() {
"use strict";
tt_id = parseInt($('#id_table_template').val(), 10);
$.ajaxJSON({
method: 'get',
url: $dj.ajax_load_template,
data: {template_id: tt_id},
dest: $('#template-edit-form'),
callback: template_form_init
});
$.ajaxJSON({
method: 'get',
url: $dj.ajax_preview_form,
data: {template_id: tt_id},
dest: $('#template-preview')
});
}
function load_preview() {
"use strict";
$.ajaxJSON({
method: 'get',
url: $dj.ajax_load_preview,
data: {
template_id: tt_id,
pattern_type_id: $('#id_pattern_type').val(),
ic_id: $('#id_inflection_characteristic').val()
},
dest: $('#preview-table')
});
}
$(function() {
"use strict";
$('#load-template').click(load_template);
$(document).on('click', '#load-preview', load_preview);
});