Advertisement
Guest User

Untitled

a guest
Feb 27th, 2020
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. onDeregistrationButton : function() {
  2. var subunitField = this.lookup('subunitField'),
  3. commonPdnDescription = this.lookup('cntrCitizenRegistrationInfo'),
  4. deregistrationBlockPosition = commonPdnDescription.items.indexOf(subunitField),
  5. pdnDeregistration = this.lookup('pdnDeregistration'),
  6. juvCase = this.getViewModel().get('juvCase');
  7.  
  8. if (!pdnDeregistration) {
  9. this.lookup('deregistrationButton').setText('Отменить снятие');
  10. commonPdnDescription.insert(deregistrationBlockPosition, this.getView().createDeregistrationBlock(this.isRegistrationParent()));
  11. juvCase.set('deregistrationDate', null);
  12. juvCase.set('deregistrationCauseId', null);
  13. }
  14. else {
  15. this.lookup('deregistrationButton').setText('Снять с учета');
  16. commonPdnDescription.remove(pdnDeregistration);
  17. juvCase.set('deregistrationDate', null);
  18. juvCase.set('deregistrationCauseId', null);
  19. }
  20. },
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement