Skip to content

Latest commit

 

History

History
92 lines (81 loc) · 2.12 KB

README.md

File metadata and controls

92 lines (81 loc) · 2.12 KB

jQuery Key-Value Json Input Plugin

A light-weight jQuery plugin that makes input json data to a single form field more friendly.

Usage

Include script after the jQuery library

<script src="/path/to/jquery.kv-json-input.js"></script>

Enable key-value json input

$('input[name="configData"]').kvJsonInput();

###Demo### http://www.lovelucy.info/demo/jquery-kv-json-input/

Config

parameter default description
addRowTriggerClass 'add-row-trigger' CSS class for button to add key-value input row.
delRowTriggerClass 'del-row-trigger' CSS class for button to delete current row.
tableClass 'table table-striped table-bordered table-hover' CSS class for genarated table for display key-value.
templateClass 'template' CSS class for key-value input template.
keyInputClass 'config-key' CSS class for key input field.
valueInputClass 'config-value' CSS class for value input field.
initData {} Initialized json data.

###Example###

$('input[name="configData"]').kvJsonInput({
    tableClass: 'myTable',
    initData:   {&quot;initKey1&quot;:&quot;initValue1&quot;}
  });

Support

###jQuery###

  • Version 1.8.3

Other version should works too but not tested.

###Browser###

  • Chrome (webkit)
  • Firefox 3.5+
  • IE 8+
  • Opera 10.5+

Older browsers may need additional json2.js to make it work.