Skip to content

Instantly share code, notes, and snippets.

View mikekotikov's full-sized avatar

Mike Kotikov mikekotikov

  • Poland, Warsaw
  • 14:06 (UTC +01:00)
View GitHub Profile
@mikekotikov
mikekotikov / example.js
Created April 14, 2021 09:53
Overriding DataGrid template
import { Templates } from 'formiojs';
Templates.framework = 'bootstrap';
// Default DataGrid template from src/templates/bootstrap/datagrid/form.ejs
// with changed header labels and added footer text for every component
Templates.current.datagrid.form = `
<table class="table datagrid-table table-bordered
{{ ctx.component.striped ? 'table-striped' : ''}}
{{ ctx.component.hover ? 'table-hover' : ''}}
@mikekotikov
mikekotikov / example.ts
Created April 7, 2021 11:22
Way to change edit form in a custom component
import { Formio } from '@formio/angular';
const Base = (Formio as any).Components.components.component;
const defaultEditForm = (Formio as any).Components.components.textfield.editForm;
import _ from 'lodash';
export default class MyCustomComponent extends Base {
/* Your component logic */
static editForm() {
const {components} = defaultEditForm();