A light-weight jQuery plugin that makes input json data to a single form field more friendly.
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/
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: {"initKey1":"initValue1"}
});
###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.