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.

getData from multiple Instances not possible (since 2.10)

See original GitHub issue

Description:

With version 2.9.x I was able to do something like this:

jQuery(function($) {
  var fbInstances = {
    	'buildWrap': $('#build-wrap').formBuilder(),
		'header': $('#header').formBuilder(),
		'content': $('#content').formBuilder(),
		'footer': $('#footer').formBuilder(),
	};


  document.getElementById('getJSON').addEventListener('click', function() {
    Object.keys(fbInstances).forEach(function(key){
      console.log(key, fbInstances[key].actions.getData())
    });
  });
});

Multiple instances of formBuilder and one button to collect all the data.

Starting with 2.10 I can’t loop through the instances anymore and even fbInstances[key].promise(f => {f.actions.getData()}); results in nothing.

Here is a minimal testcase: https://codepen.io/localhorst/pen/dBorvL

For a single instance it seems to work, and the demo with multiple forms works as well (I updated it with the latest versions https://codepen.io/localhorst/pen/OeVGaZ)

But I can’t make it work in my case. Any help is appreciated!

Environment Details:

  • formBuilder Version: 3.x (since 2.10)
  • Browser: all
  • OS: all

Expected Behavior

Get data from multiple instances via fbInstances[key].actions.getData()

Actual Behavior

actions.*is not available

Steps to Reproduce

https://codepen.io/localhorst/pen/dBorvL

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:4
  • Comments:7

github_iconTop GitHub Comments

1reaction
chiahungwangcommented, Oct 1, 2019

You can try it like this, Init by Recursive Function. https://codepen.io/chiahungwang/pen/PoYrMEZ?editors=1010

Read more comments on GitHub >

github_iconTop Results From Across the Web

Use IMDSv2 - Amazon Elastic Compute Cloud
Use Instance Metadata Service Version 2 (IMDSv2) to access instance metadata from an Amazon EC2 ... It is currently not available in the...
Read more >
gpg failed to sign the data fatal: failed to write commit object ...
I uninstalled Git 2.8 (git-scm) on Windows. And installed 2.10. Now I get gpg failed to sign the data every time I use...
Read more >
Confluence will not start due to fatal error in Confluence cluster
Confluence will not start due to fatal error in Confluence cluster ... Multiple instances of Confluence are deployed, connecting to the same database....
Read more >
2.10.1 Initializing the Data Directory - MySQL :: Developer Zone
This section describes how to initialize the data directory manually for MySQL installation methods for which data directory initialization is not automatic.
Read more >
Managing multiple Postfix instances on a single host
Multi -instance support is available with Postfix version 2.6 and later. ... Since there is no single right way to configure your system,...
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