Comments (2)
Hi,
Here is some code example:
<div class='fb-main'></div>
<script>
$(document).ready(function() {
var fb = new Formbuilder({
selector: '.fb-main',
bootstrapData: jQuery.parseJSON('<?php echo $form->fields; ?>'),
});
Formbuilder.options.HTTP_ENDPOINT = "<?php echo add_query_arg('form_id',$form->ID, wp_nonce_url( admin_url('admin-ajax.php') )); ?>";
Formbuilder.options.HTTP_SAVE_ACTION = "fv_save_form_structure";
Formbuilder.options.HTTP_RESET_ACTION = "fv_reset_form_structure";
Formbuilder.options.HTTP_METHOD = "POST";
});
</script>
from formbuilder.
BuilderView.prototype.initialize = function(options) {
var selector;
selector = options.selector,
this.formBuilder = options.formBuilder,
this.bootstrapData = options.bootstrapData;
if (selector != null)
{
this.setElement($(selector));
}
this.collection = new FormbuilderCollection;
this.collection.bind('add', this.addOne, this);
this.collection.bind('reset', this.reset, this);
this.collection.bind('change', this.handleFormUpdate, this);
this.collection.bind('destroy add reset', this.hideShowNoResponseFields, this);
this.collection.bind('destroy', this.ensureEditViewScrolled, this);
this.render();
this.collection.reset(this.bootstrapData);
return this.bindSaveEvent();
};
This is the new code and I am creating a meanJS application. Based on your code it seems like I have to send data into this function by options.bootstrapData.
from formbuilder.
Related Issues (20)
- build yaml instead of json
- Checkbox group
- Sometimes custom field disapears
- Sometimes field needs doubleclick to activate
- Clicking on one field enables second field
- Contact
- A new form builder library
- Revert Drag and drop result
- formbuilder
- using form builder in asp .net C# project
- Project is alive or not? HOT 2
- There is a bug
- edit-response-field
- 如何将表单保存生成可输入表单页
- checkboxes click don't trigger change
- conditional fields HOT 2
- where i can get generated form code?
- how can i add field type as hidden?
- How to add new tab button beside add new field
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from formbuilder.