namibia
df0489e1eeeeab5a9bd44e1d84fce49924fe1bac
namibia / public / templates / page / loginreport.js
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 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
var template_loginreport = function( static ) { this.static = static; this.elements = { group : new App.TemplateElement.FieldComponent('group'), groupDivision : new App.TemplateElement.FieldComponent('groupDivision'), company : new App.TemplateElement.FieldComponent('company') }; this.ti = null; this.init = function( ti ) { this.ti = ti; App.DataStore.loadSelectListData('groups', true, 'Company', 'Group.SelectList'); App.API.getTask( 'reportLogin', 'Report', 'Report.Login', null, {}, function(){}, _w.taskContractError ); this.ti.hydrate({ 'group' : { type : 'select', id : 'group', title : 'Group Member', value : '', dataStoreId : 'groups', onChange : function () { if (!App.DataStore.getItem('BuildSelect:group', false)) { var groupId = $('#group').val(); $('#groupDivision').val(''); $('#company').val(''); App.DataStore.loadSelectListData( 'groupdivisions', false, 'Company', 'GroupDivision.SelectList', null, {Filter: {group: groupId}} ); App.DataStore.loadSelectListData( 'companies', false, 'Company', 'Company.SelectList', null, {Filter: {group: groupId}} ); } } }, 'groupDivision' : { type : 'select', id : 'groupDivision', title : 'Group Division', value : '', dataStoreId : 'groupdivisions', onChange : function () { if (!App.DataStore.getItem('BuildSelect:groupDivision', false)) { var groupDivisionId = $('#groupDivision').val(); $('#company').val(''); App.DataStore.loadSelectListData( 'companies', false, 'Company', 'Company.SelectList', null, {Filter: {groupDivision: groupDivisionId}} ); } } }, 'company' : { type : 'select', id : 'company', title : 'Company', value : '', dataStoreId : 'companies' } }); }; this.construct = function() { $('#frmLoginReport').validate({ rules: { dateFrom: {required: true, number: true} }, submitHandler: function( form ) { var data = {Report: _t['loginreport'].harvest()}; App.API.execTask( 'reportLogin', data, {}, function () {}, _w.taskExecError, 'EXPORT', true ); } }); $('#btnReport').prop('disabled', false); }; this.destruct = function() {}; }; |
Commits for namibiapublic/templates/page/loginreport.js
Revision | Author | Commited | Message |
---|---|---|---|
df0489 ... | Mark | Fri 14 Oct, 2016 10:01:00 +0000 | initial commit |