Fields will be cleand on no selection
This commit is contained in:
parent
61f612b5f3
commit
df25ec6a08
Binary file not shown.
@ -70,6 +70,8 @@ extension ViewController: NSTableViewDataSource, NSTableViewDelegate {
|
|||||||
self.txtTicketCreated.stringValue = ticket.created.toString()
|
self.txtTicketCreated.stringValue = ticket.created.toString()
|
||||||
self.txtTicketCreatedBy.stringValue = ticket.customerUserID
|
self.txtTicketCreatedBy.stringValue = ticket.customerUserID
|
||||||
self.txtTicketPriority.stringValue = ticket.priority
|
self.txtTicketPriority.stringValue = ticket.priority
|
||||||
|
} else {
|
||||||
|
self.cleanField()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -29,11 +29,13 @@ class ViewController: NSViewController {
|
|||||||
override func viewDidLoad() {
|
override func viewDidLoad() {
|
||||||
super.viewDidLoad()
|
super.viewDidLoad()
|
||||||
|
|
||||||
|
// Do any additional setup after loading the view.
|
||||||
|
|
||||||
|
|
||||||
ticketTableView.delegate = self
|
ticketTableView.delegate = self
|
||||||
ticketTableView.dataSource = self
|
ticketTableView.dataSource = self
|
||||||
|
|
||||||
// Do any additional setup after loading the view.
|
self.cleanField()
|
||||||
|
|
||||||
if UserDefaults.standard.string(forKey: Constants.USER_SETTINGS.CREDENTIALS.USER) != nil {
|
if UserDefaults.standard.string(forKey: Constants.USER_SETTINGS.CREDENTIALS.USER) != nil {
|
||||||
txtUsername.stringValue = UserDefaults.standard.string(forKey: Constants.USER_SETTINGS.CREDENTIALS.USER)!
|
txtUsername.stringValue = UserDefaults.standard.string(forKey: Constants.USER_SETTINGS.CREDENTIALS.USER)!
|
||||||
@ -66,6 +68,16 @@ class ViewController: NSViewController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func cleanField() {
|
||||||
|
self.txtTicketQue.stringValue = ""
|
||||||
|
self.txtTicketNumber.stringValue = ""
|
||||||
|
self.txtTicketOwner.stringValue = ""
|
||||||
|
self.txtTicketTitle.stringValue = ""
|
||||||
|
self.txtTicketCreated.stringValue = ""
|
||||||
|
self.txtTicketCreatedBy.stringValue = ""
|
||||||
|
self.txtTicketPriority.stringValue = ""
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// MARK: Actions
|
// MARK: Actions
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user