"use strict";(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["portal-hr-my_profile-JobApplicantLicenseSubViewController","portal-hr-my_profile-JobApplicantSubBaseViewController","JobApplicantLicenseSubViewController","JobApplicantSubBaseViewController"],{536:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"JobApplicantLicenseSubViewController\": () => (/* binding */ JobApplicantLicenseSubViewController)\n/* harmony export */ });\n/* harmony import */ var _views_portal_hr_my_profile_JobApplicantSubBaseViewController__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3757);\n/* provided dependency */ var _ = __webpack_require__(9050);\n\n\nclass JobApplicantLicenseSubViewController extends _views_portal_hr_my_profile_JobApplicantSubBaseViewController__WEBPACK_IMPORTED_MODULE_0__.JobApplicantSubBaseViewController {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {} );\n\n\t\tsuper( options );\n\t}\n\n\tinit( options ) {\n\t\tthis.qualification_type_id = 30;\n\t}\n\n\tgetJobApplicantLicense( callback ) {\n\t\tvar $this = this;\n\t\tvar filter = {};\n\t\tfilter.filter_data = {};\n\t\tfilter.filter_data.id = this.model.id;\n\t\tthis.api['getJobApplicantLicense']( filter, {\n\t\t\tonResult: function( result ) {\n\t\t\t\tif ( result.isValid() ) {\n\t\t\t\t\tvar result_data = result.getResult();\n\t\t\t\t\tif ( !result_data ) {\n\t\t\t\t\t\tresult_data = [];\n\t\t\t\t\t}\n\t\t\t\t\tresult_data = result_data[0];\n\t\t\t\t\t$this.model.set( result_data );\n\t\t\t\t\tif ( callback ) {\n\t\t\t\t\t\tcallback();\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$this.showErrorAlert( result );\n\t\t\t\t\tProgressBar.closeOverlay();\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t}\n\n\tsetCurrentEditRecordData() {\n\t\tsuper.setCurrentEditRecordData();\n\t\tvar field_selector;\n\t\tvar field_control;\n\t\t//Set current edit record data to all widgets\n\t\tfor ( var key in this.model.attributes ) {\n\t\t\tif ( !this.model.has( key ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tswitch ( key ) {\n\t\t\t\tdefault:\n\t\t\t\t\tif ( this.model.get( key ) === false ) {\n\t\t\t\t\t\tthis.model.set( key, '' );\n\t\t\t\t\t\tif ( key === 'qualification_id' && this.enable_add_qualification ) {\n\t\t\t\t\t\t\tthis.showAddQualificationContainer();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tfield_selector = '.form-control[name=\"' + key + '\"]';\n\t\t\t\t\tfield_control = this.$( field_selector );\n\t\t\t\t\tif ( field_control && field_control[0] ) {\n\t\t\t\t\t\tthis.$( field_selector ).val( this.model.get( key ) );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\t\t}\n\t}\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTM2LmpzIiwibWFwcGluZ3MiOiI7Ozs7OztBQUFtSDs7QUFFNUcsbURBQW1ELDRIQUFpQztBQUMzRiwyQkFBMkI7QUFDM0IsRUFBRSxDQUFDLHVCQUF1Qjs7QUFFMUI7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLE1BQU07QUFDTjtBQUNBO0FBQ0E7QUFDQTtBQUNBLElBQUk7QUFDSjs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQT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dldCgga2V5ICkgPT09IGZhbHNlICkge1xuXHRcdFx0XHRcdFx0dGhpcy5tb2RlbC5zZXQoIGtleSwgJycgKTtcblx0XHRcdFx0XHRcdGlmICgga2V5ID09PSAncXVhbGlmaWNhdGlvbl9pZCcgJiYgdGhpcy5lbmFibGVfYWRkX3F1YWxpZmljYXRpb24gKSB7XG5cdFx0XHRcdFx0XHRcdHRoaXMuc2hvd0FkZFF1YWxpZmljYXRpb25Db250YWluZXIoKTtcblx0XHRcdFx0XHRcdH1cblx0XHRcdFx0XHR9XG5cdFx0XHRcdFx0ZmllbGRfc2VsZWN0b3IgPSAnLmZvcm0tY29udHJvbFtuYW1lPVwiJyArIGtleSArICdcIl0nO1xuXHRcdFx0XHRcdGZpZWxkX2NvbnRyb2wgPSB0aGlzLiQoIGZpZWxkX3NlbGVjdG9yICk7XG5cdFx0XHRcdFx0aWYgKCBmaWVsZF9jb250cm9sICYmIGZpZWxkX2NvbnRyb2xbMF0gKSB7XG5cdFx0XHRcdFx0XHR0aGlzLiQoIGZpZWxkX3NlbGVjdG9yICkudmFsKCB0aGlzLm1vZGVsLmdldCgga2V5ICkgKTtcblx0XHRcdFx0XHR9XG5cdFx0XHRcdFx0YnJlYWs7XG5cblx0XHRcdH1cblx0XHR9XG5cdH1cbn1cbiJdLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///536\n")},3757:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"JobApplicantSubBaseViewController\": () => (/* binding */ JobApplicantSubBaseViewController)\n/* harmony export */ });\n/* harmony import */ var _views_portal_PortalBaseViewController__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(97);\n/* harmony import */ var _services_TimeTrexClientAPI__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7526);\n/* harmony import */ var _global_TTUUID__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4936);\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\n\n\n\n\nclass JobApplicantSubBaseViewController extends _views_portal_PortalBaseViewController__WEBPACK_IMPORTED_MODULE_0__.PortalBaseViewController {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tevents: {\n\t\t\t\t'change input[type=\"text\"]': 'onFormItemChange',\n\t\t\t\t'change input[type=\"checkbox\"]': 'onFormItemChange',\n\t\t\t\t'change select.form-control': 'onFormItemChange',\n\t\t\t\t'change textarea.form-control': 'onFormItemChange'\n\t\t\t\t// 'click .styled-select .glyphicon': 'onSelectClick',\n\t\t\t}\n\t\t} );\n\n\t\tsuper( options );\n\t}\n\n\tpreInit( options ) { //Since this is an intermediary class between *SubViewController and PortalBaseViewController, we need to use preInit() so this is called before init() of each child class.\n\t\tthis.api = _services_TimeTrexClientAPI__WEBPACK_IMPORTED_MODULE_1__/* .TTAPI.APIJobApplicantPortal */ .y.APIJobApplicantPortal;\n\t\tthis.qualification_api = _services_TimeTrexClientAPI__WEBPACK_IMPORTED_MODULE_1__/* .TTAPI.APIQualificationPortal */ .y.APIQualificationPortal;\n\t\tthis.company_api = _services_TimeTrexClientAPI__WEBPACK_IMPORTED_MODULE_1__/* .TTAPI.APICompanyPortal */ .y.APICompanyPortal;\n\t\tthis.sub_view_id = options.sub_view_id;\n\t\tthis.display_columns = options.display_columns;\n\t\tthis.table_container = options.table_container;\n\t\tthis.available_fields = options.available_fields;\n\t\tthis._delegate = options._delegate;\n\t\tthis.edit_view_error_ui_dic = {};\n\t\tthis.enable_add_qualification = options.enable_add_qualification || false;\n\n\t}\n\n\tpostInit() {\n\t\tif ( !this.model.id ) {\n\t\t\tthis.setEditView();\n\t\t} else {\n\t\t\tthis.render();\n\t\t}\n\t}\n\n\trender() {\n\t\tvar $this = this;\n\t\tvar list_tpl = Global.loadWidget( 'views/portal/hr/my_profile/MyProfileSubView.html' );\n\t\tvar unique_id = this.sub_view_id + '-' + this.model.id;\n\t\tthis.unique_id = unique_id;\n\t\tthis.sub_view = _.template( list_tpl )( {} );\n\t\tif ( this.table_container.find( '.table-container' ).length == 0 ) {\n\t\t\tthis.table_container.html( '
' );\n\t\t}\n\t\tif ( this.table_container.find( '#' + unique_id ).length === 0 ) {\n\t\t\tvar tbody = $( '' ).attr( 'id', unique_id );\n\t\t\t$( this.table_container.find( 'tbody' )[0] ).append( tbody );\n\t\t} else {\n\t\t\tthis.table_container.find( '#' + unique_id ).html( '' );\n\t\t}\n\t\tvar thead = $( '
' );\n\t\tfor ( var column in this.display_columns ) {\n\t\t\tif ( !this.display_columns.hasOwnProperty( column ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// comment this, this will cause some default display columns cannot be shown.\n\t\t\t// if ( !this.available_fields.hasOwnProperty( column ) ) {\n\t\t\t// \tcontinue;\n\t\t\t// }\n\t\t\tvar column_val;\n\t\t\tswitch ( column ) {\n\t\t\t\tcase 'is_current_employer':\n\t\t\t\tcase 'is_contact_available':\n\t\t\t\t\tif ( this.model.get( column ) ) {\n\t\t\t\t\t\tcolumn_val = $.i18n._( 'Yes' );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcolumn_val = $.i18n._( 'No' );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tif ( !this.model.get( column ) ) {\n\t\t\t\t\t\tcolumn_val = '';\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcolumn_val = this.model.get( column );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tthead.append( '' + this.display_columns[column] + ' | ' );\n\t\t\tthis.table_container.find( '#' + unique_id ).append( '' + column_val + ' | ' );\n\t\t}\n\t\tthead.append( '' + $.i18n._( 'Action' ) + ' | ' );\n\t\tif ( this.table_container.find( 'thead' ).html() === '' ) {\n\t\t\tthis.table_container.find( 'thead' ).html( thead );\n\t\t}\n\t\tthis.table_container.find( '#' + unique_id ).append( this.sub_view );\n\t\tthis.table_container.find( '#' + unique_id ).find( '.edit-icon' ).unbind( 'click' ).bind( 'click', function( e ) {\n\t\t\t$this['get' + $this.sub_view_id]( function() {\n\t\t\t\t$this.setEditView();\n\t\t\t} );\n\t\t} );\n\t\tthis.table_container.find( '#' + unique_id ).find( '.delete-icon' ).unbind( 'click' ).bind( 'click', function( e ) {\n\t\t\t$this['get' + $this.sub_view_id]( function() {\n\t\t\t\t$this.onDeleteClick();\n\t\t\t} );\n\t\t} );\n\t}\n\n\tinitOptions() {\n\t\tvar $this = this;\n\t\tvar args = {};\n\t\tvar filter_data = {};\n\t\tfilter_data.type_id = [this.qualification_type_id];\n\t\targs.filter_data = filter_data;\n\t\targs.filter_columns = {\n\t\t\t'id': true,\n\t\t\t'name': true\n\t\t};\n\t\tthis.qualification_api.getQualification( args, true, {\n\t\t\tonResult: function( result ) {\n\t\t\t\tvar res = result.getResult();\n\t\t\t\tvar options = {};\n\t\t\t\tfor ( var i in res ) {\n\t\t\t\t\tif ( !res.hasOwnProperty( i ) ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tvar row = res[i];\n\t\t\t\t\toptions[row.id] = $.i18n._( row.name );\n\t\t\t\t}\n\t\t\t\t$this.setSourceData( 'qualification_id', options, true );\n\t\t\t}\n\t\t} );\n\t}\n\n\tonSelectClick( e ) {\n\t\tvar elem = $( e.currentTarget ).parent().find( 'select' );\n\t\tif ( document.createEvent ) {\n\t\t\tvar e = document.createEvent( 'MouseEvents' );\n\t\t\te.initMouseEvent( 'mousedown', true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null );\n\t\t\telem[0].dispatchEvent( e );\n\t\t} else if ( element.fireEvent ) {\n\t\t\telem[0].fireEvent( 'onmousedown' );\n\t\t}\n\t}\n\n\tsetEditView() {\n\t\tvar tpl = Global.loadWidget( 'views/portal/hr/my_profile/' + this.sub_view_id + 'SubEditView.html' );\n\t\tthis.setElement( _.template( tpl )( {\n\t\t\tavailable_fields: this.available_fields,\n\t\t\tenable_add_qualification: this.enable_add_qualification\n\t\t} ) );\n\t\tthis.initOptions();\n\t\tthis.registerDatePicker();\n\t\tthis.setCurrentEditRecordData();\n\t\tthis.openEditView();\n\t}\n\n\tonDeleteClick() {\n\t\tvar $this = this;\n\t\tIndexViewController.instance.router.showConfirmModal( Global.delete_confirm_message, {\n\t\t\ttitle: '',\n\t\t\tactions: [\n\t\t\t\t{ label: 'No', isClose: true },\n\t\t\t\t{\n\t\t\t\t\tlabel: 'Yes', callBack: function( e ) {\n\t\t\t\t\t\t$this.closeConfirmModal();\n\t\t\t\t\t\tProgressBar.showOverlay();\n\t\t\t\t\t\t$this.api['delete' + $this.sub_view_id]( $this.model.id, {\n\t\t\t\t\t\t\tonResult: function( result ) {\n\t\t\t\t\t\t\t\tProgressBar.closeOverlay();\n\t\t\t\t\t\t\t\tif ( result.isValid() ) {\n\t\t\t\t\t\t\t\t\t// $this.remove();\n\t\t\t\t\t\t\t\t\t// $this.table_container.find('#'+$this.unique_id).remove();\n\t\t\t\t\t\t\t\t\t$this._delegate.setSubViews( $this.sub_view_id, $this.display_columns );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t$this.showErrorAlert( result );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t]\n\t\t} );\n\t}\n\n\tsetSourceData( field, source_data, set_empty ) {\n\t\tvar $this = this;\n\t\tvar field_selector = 'select[name=\"' + field + '\"]';\n\t\tif ( this.$( field_selector ) && this.$( field_selector )[0] ) {\n\t\t\tthis.$( field_selector ).empty();\n\t\t} else {\n\t\t\treturn;\n\t\t}\n\t\tif ( !Global.isSet( this.model.get( field ) ) ) {\n\t\t\tthis.model.set( field, '' ); // initialize a value;\n\t\t}\n\t\tif ( _.size( source_data ) == 0 ) {\n\t\t\tset_empty = true;\n\t\t\tthis.model.set( field, '' );\n\t\t}\n\t\tswitch ( field ) {\n\t\t\tcase 'qualification_id':\n\t\t\t\tif ( this.enable_add_qualification ) {\n\t\t\t\t\tvar option_name;\n\t\t\t\t\tswitch ( this.sub_view_id ) {\n\t\t\t\t\t\tcase 'JobApplicantSkill':\n\t\t\t\t\t\t\toption_name = $.i18n._( 'Add New Skill' );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'JobApplicantEducation':\n\t\t\t\t\t\t\toption_name = $.i18n._( 'Add New Course' );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'JobApplicantLicense':\n\t\t\t\t\t\t\toption_name = $.i18n._( 'Add New Type' );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'JobApplicantLanguage':\n\t\t\t\t\t\t\toption_name = $.i18n._( 'Add New Language' );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'JobApplicantMembership':\n\t\t\t\t\t\t\toption_name = $.i18n._( 'Add New Membership' );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tset_empty = false;\n\t\t\t\t\tthis.$( field_selector ).append( $( '' ).prop( 'value', '' ).text( '-- ' + option_name + ' --' ) );\n\t\t\t\t}\n\t\t\t//break; -- Do not break here, it should fall through to default.\n\t\t\tdefault:\n\t\t\t\tif ( set_empty === true ) {\n\t\t\t\t\tthis.$( field_selector ).append( $( '' ).prop( 'value', '' ).text( '-- ' + $.i18n._( 'None' ) + ' --' ) );\n\t\t\t\t}\n\t\t\t\tif ( _.size( source_data ) > 0 ) {\n\t\t\t\t\t$.each( source_data, function( value, label ) {\n\t\t\t\t\t\t$this.$( field_selector ).append( $( '' ).prop( 'value', value ).text( label ) );\n\t\t\t\t\t\tif ( $this.model.get( field ) == value ) {\n\t\t\t\t\t\t\t$this.$( field_selector ).val( value );\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t\t$this.$( field_selector ).selectpicker();\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tregisterDatePicker() {\n\t\tvar time_format = 'h:mm TT';\n\t\tvar format = 'dd-M-y';\n\t\tvar focus_out_timer;\n\t\tvar is_open = false;\n\t\t// When portal mode, no user preference.\n\t\t// if ( LocalCacheData.getLoginUserPreference() ) {\n\t\t// \tformat = LocalCacheData.getLoginUserPreference().date_format_1;\n\t\t// \ttime_format = LocalCacheData.getLoginUserPreference().time_format_1;\n\t\t// }\n\t\tvar day_name_min = [\n\t\t\t$.i18n._( 'Sun' ), $.i18n._( 'Mon' ), $.i18n._( 'Tue' ),\n\t\t\t$.i18n._( 'Wed' ), $.i18n._( 'Thu' ), $.i18n._( 'Fri' ), $.i18n._( 'Sat' )\n\t\t];\n\t\tvar month_name_short = [\n\t\t\t$.i18n._( 'Jan' ), $.i18n._( 'Feb' ),\n\t\t\t$.i18n._( 'Mar' ), $.i18n._( 'Apr' ), $.i18n._( 'May' ),\n\t\t\t$.i18n._( 'Jun' ), $.i18n._( 'Jul' ), $.i18n._( 'Aug' ),\n\t\t\t$.i18n._( 'Sep' ), $.i18n._( 'Oct' ), $.i18n._( 'Nov' ),\n\t\t\t$.i18n._( 'Dec' )\n\t\t];\n\t\tvar current_text = $.i18n._( 'Today' );\n\t\tvar close_text = $.i18n._( 'Close' );\n\t\tvar options = {\n\t\t\tshowTime: false,\n\t\t\tdateFormat: format,\n\t\t\tshowHour: false,\n\t\t\tshowMinute: false,\n\t\t\tchangeMonth: true,\n\t\t\tchangeYear: true,\n\t\t\tshowButtonPanel: true,\n\t\t\tduration: '',\n\t\t\tshowAnim: '',\n\t\t\tyearRange: '-100:+10',\n\t\t\tshowOn: '',\n\t\t\tdayNamesMin: day_name_min,\n\t\t\tcurrentText: current_text,\n\t\t\tmonthNamesShort: month_name_short,\n\t\t\tcloseText: close_text,\n\t\t\tbeforeShow: function() {\n\t\t\t},\n\t\t\tonSelect: function( dateText ) {\n\t\t\t\t$( this ).change();\n\t\t\t},\n\t\t\tonClose: function() {\n\t\t\t\tfocus_out_timer = setTimeout( function() {\n\t\t\t\t\tis_open = false;\n\t\t\t\t}, 100 );\n\t\t\t}\n\n\t\t};\n\t\tthis.$( 'input[type=\"text\"].datepicker' ).datepicker( options );\n\t\tthis.$( 'input[type=\"text\"].datepicker' ).attr( 'placeholder', 'dd-mmm-yy' );\n\t\tthis.$( 'input[type=\"text\"].datepicker' ).bind( 'mouseup', function() {\n\t\t\tif ( !is_open ) {\n\t\t\t\t$( this ).datepicker( 'show' );\n\t\t\t\tis_open = true;\n\t\t\t} else {\n\t\t\t\tis_open = false;\n\t\t\t\tif ( focus_out_timer ) {\n\t\t\t\t\tclearTimeout( focus_out_timer );\n\t\t\t\t\tfocus_out_timer = null;\n\t\t\t\t}\n\t\t\t}\n\t\t} ).next('.glyphicon').bind( 'mouseup', function() { $(this).prev().trigger( 'mouseup' ) } ); // this allows clicking on the calendar icon as well as the input box\n\t}\n\n\tsetCurrentEditRecordData() {\n\t\tvar self = this;\n\t\tvar unindexed_array = this.$( '.detail-form' ).serializeArray();\n\t\t$.map( unindexed_array, function( row, i ) {\n\t\t\tif ( !Global.isSet( self.model.get( row['name'] ) ) ) {\n\t\t\t\tself.model.set( row['name'], row['value'] );\n\t\t\t}\n\t\t} );\n\t\tif ( !this.model.has( 'qualification_id' ) ) {\n\t\t\tthis.model.set( 'qualification_id', false );\n\t\t}\n\t}\n\n\taddQualification() {\n\t\tvar $this = this;\n\t\tvar args = {};\n\t\targs.type_id = this.qualification_type_id;\n\t\tvar name = args.name = this.getQualificationWidget().val();\n\t\tthis.qualification_api.setQualification( args, {\n\t\t\tonResult: function( res ) {\n\t\t\t\tif ( !res.isValid() ) {\n\t\t\t\t\t$this.setErrorTips( res );\n\t\t\t\t} else {\n\t\t\t\t\t$this.$( 'select[name=\\'qualification_id\\']' ).selectpicker( 'destroy' );\n\t\t\t\t\tvar new_id = res.getResult();\n\t\t\t\t\t$( '