定制 sazanof/dynamic-panels 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

sazanof/dynamic-panels

Composer 安装命令:

composer require sazanof/dynamic-panels

包简介

Pure JavaScript addon for dynamically adding and removing html blocks with form elements and preparing for the subsequent sending of structured data to the server

README 文档

README

Pure JavaScript addon for dynamically adding and removing html blocks with form elements and preparing for the subsequent sending of structured data to the server

Дополнение на чистом JavaScript для возможности добавления динамических элементов форм на странице. Без зависимостей.

Installation / Установка

composer require sazanof/dynamic-panels

Or you can just download the repo using Git

Initialization / Инициализация

<script src="path/to/polyfills.js"></script>
<script src="path/to/dynamic-panels.js"></script>

Usage / Использование

<script>
    window.addEventListener('DOMContentLoaded',function () {
        var ex1 = new DynamicPanels({
            id:'example1',
            name_key:'details'
        }).init();
        var ex2 = new DynamicPanels({
            id: 'example2',
            name_key: 'dd',
            classes: {
                inner :'.custom_dp_class',
                header : '.custom_dp_class-header',
                title : '.custom_dp_class-title',
                actions : '.custom_dp_class-actions'
            }
        }).init();
    })
</script>

Dependences

No dependences

Polyfills

Some Browsers like IE did not understand such methods like forEach or closest and match. If you want to use it, just include the pollyfills.js in you project, or use dynamic-panels-w-polyfill.js

Некоторые браузеры (например Internet Explorer) не понимают forEach, closest, match. Можете использовать pollyfills.js в проекте или же просто подключить dynamic-panels-w-polyfill.js

HTML structure / Структура HTML кода

Required html attributes in child element block. Обязательные атрибуты элементов:

<div id="example1"> <!--ID of element-- >
    <div class="dynamic" data-pos="1"> <!-- basic class and data-pos=1 -- >
        <div class="dynamic-header"><!-- basic class -- >
            <div class="dynamic-title"><!-- basic class -- >
                Position #<span>1</span><!-- span required! -- >
            </div>
            <div class="dynamic-actions"><!-- basic class -- >
                <span class="btn" data-plus>+</span><!-- data-plus -- >
                <span class="btn" data-minus>-</span><!-- data-plus -- >
            </div>
        </div>
        <div class="form-group-inner">
            <input type="text" name="details[1][title]"><!-- name like this -- >
        </div>
    </div>
</div>

Name structure like name_key - details[1 - basic number][title - your subkey]

统计信息

  • 总下载量: 9
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: JavaScript

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-11-15

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固