import {
    FormControl,
    FormGroup
} from "@angular/forms";
import {
    MagicServices
} from "@magic-xpa/angular";
export enum MgControlName {
    TodoListList = "TodoListList",
        TTodoList = "TTodoList",
        TC_ToDo = "TC_ToDo",
        MToDo_ToDo = "MToDo_ToDo",
        Column134217735 = "Column134217735",
        BtnEdit = "BtnEdit",
        Column134217737 = "Column134217737",
        BtnDelete = "BtnDelete",
}
export enum MgCustomProperties {}
export var
    MgDisplayedColumns = [
        'TC_ToDo',
        'Column134217735',
        'Column134217737',
    ];

export class MgFormControlsAccessor {
    constructor(private fg: FormGroup, private magicServices: MagicServices) {}

    get MToDo_ToDo(): FormControl {
        return this.getTableChildFormControl(MgControlName.MToDo_ToDo);
    }

    getTableChildFormControl(name: MgControlName): FormControl {
        return this.magicServices.mgAccessorService.getFormGroupByRow(this.magicServices.tableService.getSelectedRow()).controls[name] as FormControl;
    }
}