Docs
API
  • Methods

    
    var form = new FancyForm({
      ...
    })
    

    To use methods immediately after initialize widget read the following note.

    If library was included fully

    
    <script src="http://cdn.fancygrid.com/fancy.full.min.js"></script>
    
    Than methods available immediately.
    
    var form = new FancyForm({
      ...
    });
    form.setTitle('new Title');
    
    
    In all other cases it is not possible to use methods immediately.
    Library needs a moment to load required modules.
    So it needs to wait till library would be inited.
    For that use event init
    
    var form = new FancyForm({
      ...,
      events: [{
        init: function(){
          formInitedFn();
        }
      }],
      ...
    });
    
    function formInitedFn(){
      form.setTitle('new Title');
    }
    
    

    To get link on widget from any place there are 2 approaches.

    If it was set renderTo property than use FancyForm.get('renderToID')

    
    new FancyForm({
      renderTo: 'formOptions',
      ...
    });
    
    function updateGridTitle(){
      var form = FancyForm.get('formOptions');
      
      form.setTitle('New Title');
    }
    
    

    Another approach to set id and to use Fancy.getWidget('formId')

    
    new FancyForm({
      id: 'myForm',
      ...
    });
    
    function updateFormTitle(){
      var form = Fancy.getWidget('myForm');
      
      form.setTitle('New Title');
    }