You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
1.1 KiB
45 lines
1.1 KiB
import {AfterViewInit, Component, OnInit, ViewChild} from '@angular/core';
|
|
import {ICellEditorParams} from 'ag-grid-community';
|
|
import {ApiService} from '../../../../../service/api.service';
|
|
import {IonicSelectableComponent} from "ionic-selectable";
|
|
|
|
@Component({
|
|
selector: 'editor-cel-page-link',
|
|
templateUrl: './page-link-editor.component.html',
|
|
styleUrls: ['./page-link-editor.component.scss'],
|
|
})
|
|
export class PageLinkEditorComponent implements OnInit {
|
|
@ViewChild('selectable') selectable: IonicSelectableComponent;
|
|
public params: ICellEditorParams;
|
|
public value: any;
|
|
public pages: any[] = [];
|
|
|
|
constructor(
|
|
public readonly api: ApiService,
|
|
) { }
|
|
|
|
agInit(params: ICellEditorParams): void {
|
|
this.params = params;
|
|
this.value = { id: this.params.value };
|
|
|
|
// @ts-ignore
|
|
this.pages = params._pagesData || [];
|
|
|
|
console.log('page link editor comp', this);
|
|
|
|
setTimeout(() => {
|
|
this.selectable.open();
|
|
});
|
|
}
|
|
|
|
getValue(): any {
|
|
return this.value.id;
|
|
}
|
|
|
|
async ngOnInit() {}
|
|
|
|
finishEdit() {
|
|
this.params.stopEditing();
|
|
}
|
|
}
|