Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 25 additions & 4 deletions index.htm
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,22 @@ <h3>Default behavior</h3>
<code>
$("#kve_default").keyvalueeditor('init');
</code>
<p>The values can get by calling getValues.</p>
<code>
var values=$("#kve_default").keyvalueeditor('getValues');
</code>
<p>The values can add programatically by calling addParams</p>
<code>
$("#kve_default").keyvalueeditor("addParams",[{key:"foo",value:"bar"}]);
</code>
<button onclick="add()">Do it!</button>
</div>

<div class="col-md-6">
<div id="kve_default"></div>
<p>Current values:</p>
<pre id="kve_default_values">
</pre>
</div>
</div>
<br><br>
Expand All @@ -61,10 +73,10 @@ <h3>Default behavior</h3>
<div id="kve_custom"></div>
</div>
</div>


</div>

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<script src="jquery.keyvalueeditor.js"></script>
Expand All @@ -81,5 +93,14 @@ <h3>Default behavior</h3>
$("#kve_custom").keyvalueeditor('init',params);

</script>
<script>
setInterval(function () {
var values=$("#kve_default").keyvalueeditor("getValues");
$("#kve_default_values").text(JSON.stringify(values,null,4));
},1000);
function add() {
$("#kve_default").keyvalueeditor("addParams",[{key:"foo",value:"bar"}]);
}
</script>
</body>
</html>
</html>