Skip to content

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

Notifications You must be signed in to change notification settings

whuhacker/jquery-kv-json-input

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

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.

About

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published