2017 © Pedro Peláez
 

yii2-extension yii2-related-form

It is a widget for melon.ng to clone form elements of related models.

image

tolik505/yii2-related-form

It is a widget for melon.ng to clone form elements of related models.

  • Friday, April 7, 2017
  • by tolik505
  • Repository
  • 1 Watchers
  • 0 Stars
  • 1,156 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 7 % Grown

The README.md

yii2-related-form

It is a widget only for melon.ng to clone form elements of related models., (*1)

Installation

The preferred way to install this extension is through composer., (*2)

Either run, (*3)

composer require tolik505/yii2-related-form

or add, (*4)

"tolik505/yii2-related-form": "dev-master"

to the require section of your composer.json file., (*5)

Usage

After CRUD generating add to getFormConfig(), (*6)

[
    'class' => tolik505\relatedForm\RelatedFormWidget::className(),
    'relation' => 'tests', //name of relation
    /*'uploadBehavior' => [ //if needed UploadBehavior
        [
            'attribute' => 'file_id',
            'extensions' => ['png', 'gif', 'jpg', 'jpeg', 'ico', 'svg'],
            'required' => true
        ]
    ],*/
]

Javascript Events


$(".dynamicform_wrapper").on("beforeInsert", function(e, item) { console.log("beforeInsert"); }); $(".dynamicform_wrapper").on("afterInsert", function(e, item) { console.log("afterInsert"); }); $(".dynamicform_wrapper").on("beforeDelete", function(e, item) { if (! confirm("Are you sure you want to delete this item?")) { return false; } return true; }); $(".dynamicform_wrapper").on("afterDelete", function(e) { console.log("Deleted item!"); }); $(".dynamicform_wrapper").on("limitReached", function(e, item) { alert("Limit reached"); });

The Versions

07/04 2017

dev-master

9999999-dev

It is a widget for melon.ng to clone form elements of related models.

  Sources   Download

BSD-3-Clause

The Requires

 

by Avatar tolik505

extension yii2 widget melon.ng