question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

adding a new component

See original GitHub issue

I would like to have two buttons next to each other in a form, say

<div class="form-group">
<button class="btn btn-primary disabled" type="submit">Save</button>
<button class="btn btn-primary" type="button" style="margin-left: 10px;">Cancel</button>
</div>

How can I create this in the formbuilder? Do I have to create a “custom component”? It is not clear for me how to do this after reading section “Adding Components” at https://github.com/formio/ngFormBuilder. Is this documented clearly for starters somewhere? At https://gitter.im/formio/formio I did not get reactions on the same question.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
zackurbencommented, Jan 3, 2017

@StefanHoutzager, You can use the block setting to make each button take the entire width of the container and you can nest multiple columns if needed.

I think thats the best option for now, unless you want to make a custom layout component, or mess with custom css. It’s possible you can use the html component to make a bootstrap row and put the buttons html as the content; however, I haven’t tried that personally.

0reactions
Morshed0308commented, Jun 13, 2019

@PetroSutch
You can create a new js file and create a new group if you want like bellow

app.config(['formioComponentsProvider', function (formioComponentsProvider) {

   formioComponentsProvider.addGroup('amazing', { title: 'Custom Template Components' });
formioComponentsProvider.register('name', {
       title: 'Your Title',
       template: 'formio/components/desiredURL.html',
       controller: ['$scope', function ($scope) {
        
       }],
       group: 'amazing',
       icon: '',
       settings: {
           input: true,
           fontSize: '',
           activeColor: '',
           multiple: false,
           protected: false,
           persistent: true,
           tableView: false
       },
       views: [
         {
             name: 'Display',
             template: 'formio/components/icons/yourURL.html'
         }
       ]
   });



if you don’t wanna create new group ,you can give the group name ‘basic’ and ignore the .addgroup() line.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular components overview
Creating a component manuallylink · Navigate to your Angular project directory. · Create a new file, <component-name>. · At the top of the...
Read more >
How to create a new component in Angular 4 using CLI
1) first go to your Project Directory · 2) then Run below Command in terminal. ng generate component componentname. OR ng g component...
Read more >
Adding a new component - Alfresco Builder Network
Adding a new component. In this tutorial, you will learn how to create a component using Angular CLI within an existing application.
Read more >
How to Create and Use Your Own Components in Angular
Create a new Angular application using ng new or open an existing one. · Open the command prompt or terminal. · In the...
Read more >
Add a new component | Jira Software Cloud - Atlassian Support
Add a new component · From your project's sidebar, select Project settings > Components.Select Create component. · Give the component a meaningful name...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found