forked from bimberlabinternal/LabDevKitModules
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpopulateInitialValues.html
More file actions
32 lines (30 loc) · 1.25 KB
/
populateInitialValues.html
File metadata and controls
32 lines (30 loc) · 1.25 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
<script type="text/javascript" nonce="<%=scriptNonce%>">
Ext4.onReady(function(){
var webpart = <%=webpartContext%>;
Ext4.create('Ext.panel.Panel', {
border: false,
items: [{
xtype: 'button',
text: 'Populate Default Values For Reference Tables',
handler: function(){
Ext4.Msg.wait('Saving...');
LABKEY.Ajax.request({
url : LABKEY.ActionURL.buildURL('laboratory', 'populateDefaults'),
params: {
tableNames: ['sample_type', 'species']
},
method : 'POST',
scope: this,
failure: LDK.Utils.getErrorCallback(),
success: function(result){
Ext4.Msg.hide();
Ext4.Msg.alert('Success', 'Default Values Populated', function(){
window.location = LABKEY.ActionURL.buildURL('project', 'start');
}, this);
}
});
}
}]
}).render(webpart.wrapperDivId);
});
</script>