unable to trigger editConfirm event below are my html and component files
- Lingua principale
- TypeScript
- Stelle
- 1.6k
- Fork
- 867
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
HTML Code:
Component File:
import { Component } from '@angular/core';
import { Ng2SmartTableModule,LocalDataSource } from 'ng2-smart-table';
import { DispatchActionService } from './dispatchaction.service';
import 'rxjs/add/operator/map';
import { ButtonRenderComponent } from './button.render.component';
@Component({
templateUrl: 'dispatchaction.component.html'
})
export class DispatchActionComponent {
datatable:any;
// users:string[]=[];
userList:any[] =[];
rowValues:any=[];
workID:string;
statusInfo:string;
dispatchActionService: any;
dispatchTable:any;
// show:boolean=false;
constructor(dispatchActionService: DispatchActionService) {
this.datatable = new LocalDataSource();
this.dispatchActionService = dispatchActionService;
this.dispatchActionService.getUsers().subscribe(result => {
let users = result;
var i:any;
var temp:any;
for(i in users){
temp ={ value:users[i].username , title:users[i].username};
this.userList.push(temp);
console.log(this.userList);
// this.show=true;
}
this.dispatchTable = {
mode: 'inline',
actions: { columnTitle: '', add: false, edit:{ confirmSave: true,editButtonContent: 'Edit',
saveButtonContent: 'Update',
cancelButtonContent: 'Cancel'},delete: false},
columns: {
// button: { title: 'Download',type: 'custom',filter:false,editable:false,renderComponent: ButtonRenderComponent},
workid: { title: 'Work Order Id',editable:false },
username: { title: 'User Name', type: 'html', editor: { type: 'list', config: {list:this.userList} } },
status: { title: 'Status',editable:false,type: 'html'},
dbDate: { title: 'Database Created',editable:false },
acceptedDate: { title: 'Accepted Date',editable:false },
updatedDate: { title: 'Updated Date',editable:false }
}
}
console.log(this.dispatchTable);
this.dispatchActionService.getAll()
.subscribe(result => {
// this.datatable = result;
this.datatable.load(result);
console.log(this.datatable);
});
})
}
ConvertStringToFloat(value){
return parseFloat(value)
}
onSaveConfirm(event)
{
console.log(event);
}
download_fnc(event){
console.log(event);
this.rowValues=event;
this.workID=this.rowValues.data.workid;
console.log(this.workID);
this.statusInfo=this.rowValues.data.status;
console.log(this.statusInfo);
if (this.statusInfo == "Survey Assigned" || this.statusInfo == "Survey Re-Assigned")
{
alert("Do you want to download " + this.workID + " ? ");
var newwind= window.open("http://........................./FileShare4FOMSSrv/rest/download/zip?workordername="+this.workID);
}
else{ alert("This File cannot be downloaded"); }
}
}
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Valutazione
Questa issue non è ancora stata valutata.