Open shilokeisar opened 3 years ago
This would be part of the component JSON that is injected into the renderer. I am not familiar with how the custom component stuff works, but from lookin at https://github.com/formio/angular-formio/blob/master/projects/angular-formio/src/custom-component/create-custom-component.ts#L43 it appears that it is defined as this.component
. This means that these settings should be available in that object.
I know this is old thread, but i think this below clue might help someone to setup the default values in the builder custom controls.
const COMPONENT_OPTIONS: FormioCustomComponentInfo = {
type: 'sqlaggrid',
selector: 'sql-grid',
editForm: minimalEditForm,
title: 'sql-grid',
group: 'basic',
icon: 'fa fa-star',
schema: {
label: 'To setup the label default value, assign the value here in schema of that control [key] name',
},
};
I'm developing in ANGULAR 10
I use form.io form-builder to render components
I add custom component that drow grid (ag-grid) According to this link add custom Components with Angular Elements
every think work well
I drag and drop the table several times to draw multiple tables.
I enclose a photo of how the form looks like after the drag and drop action into the form
The problem .
when form.io render my custom component that draw the ag-grid , i need to get the connection string and the sql statement from the component definition (json).
I do not know how to get this information from my custom component at the time it's be rendering. Without this information, I do not know generate the column names and row's content.
builder component contain the formio tag
aggrid component is my custom component for display ag grid
import { Injector } from '@angular/core'; import { FormioCustomComponentInfo, registerCustomFormioComponent } from 'angular-formio'; import { AggridWrapperComponent } from './aggrid-wrapper.component';
I am missing the reference to the component definition
any idea ?