Delete data:
After selecting the data to be deleted, select the delete button. The confirmation dialog box appears. After confirming, the data is deleted.
Code:
Private function onCloseEvent (evt: CloseEvent): void {if (evt. detail = Alert. YES) {var rowID: int = this. _ dataGrid. selectedItem ["id"]; var obj: RemoteObject = new RemoteObject ("GetStudents"); obj. addEventListener (FaultEvent. FAULT, rError); // obj. addEventListener (ResultEvent. RESULT, delData); obj. del (rowID); this. getStudents (0) ;}} private function delData (evt: ResultEvent): void {var stu: Students = evt. result as S Tudents; var obj: RemoteObject = new RemoteObject ("GetStudents"); obj. addEventListener (FaultEvent. FAULT, rError); obj. del (stu); this. getStudents (0);} private function exec_del (): void {if (this. _ dataGrid. selectedItem! = Null) Alert. show ("are you sure you want to delete this data? "," Prompt ", Alert. YES | Alert. NO, null, onCloseEvent); elseAlert. show (" NO data selected ");}