Giter Club home page Giter Club logo

Comments (2)

max-kk avatar max-kk commented on August 16, 2024

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.

chirag-recognite avatar chirag-recognite commented on August 16, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.