Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var CertificacionRenovarAviso = BaseView.extend({
- events: {
- "click .btn-renovar": "renovar",
- },
- initialize: function () {
- CertificacionRenovarAviso.__super__.initialize.apply(this, arguments)
- this.workingEl = '.btn-renovar'
- this.template = Handlebars.compile($("#certificacionRenovarAviso").html())
- this.model = new MisCertificacionesModel()
- $(this.$el)
- .html(this.template(this.model.toJSON()))
- .addClass("certificacion-renovar-aviso-block modal fade")
- _.bindAll(this, "render")
- },
- ID: '',
- renovar: function () {
- if (this.model.isValid(true)) {
- this.save()
- }
- },
- setModel: function (attrs) {
- this.model.attributes = attrs
- ID = this.model.get("ID")
- this.applyBindings()
- },
- save: function () {
- if (this.isWorking)
- return
- var self = this
- this.startWorking()
- this.model.set("ID", ID)
- this.model.customUrl = "/api/certificacion/renovarAviso/" + ID
- alert(this.model.customUrl)
- this.model.save({},
- {
- //*
- success: function (err, response)
- {
- self.stopWorking({ showPopover: true })
- setTimeout(function ()
- {
- $(self.$el).modal("hide")
- window.location.assign('#')
- }, 3000)
- },
- error: self.xhrError,
- beforeSend: self.beforeSend
- //*/
- })
- },
- render: function () {
- return this
- }
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement