Ich habe dynamische Eingabeformularfelder gefüllt. es ist erfolgreich ausgefüllt. Ich habe keine Idee, wie man Daten in der Datenbank speichert, indem ich put/post api benutze. wie ich get api benutze.dynamische Eingabeform Daten in Datenbank speichern kendo ui
- HTML-Code
<div id="renderform" class="form horizontal-form form-body">
<!-- container UL to host input fields -->
<div class="row" data-template="fieldsTemplate" data-bind="source:fields">
</div>
<!-- button to save changes -->
<button id="save" class="btn btn-circle btn-sm btn-default" type="button">Save</button>
</div>
- Kendo Vorlage
<script id="fieldsTemplate" type="text/x-kendo-template">
<div class="form-group">
<label class="control-label" data-bind="attr: { for: name}, text: ItemLabel"></label>
<div class="">
<input class="form-control-static" type="text" />
</div>
</div>
</script>
- Ajax-Funktion
<script type="text/javascript">
// retrieve the model from an API call
$.ajax({
url: crudServiceBaseUrl + "FormItemsDesign/GetFormItemsDesignList?parentid=" + formdesignid,
//url :"json.txt",
type: "GET",
dataType: "json",
success: function (model) {
// convert the JSON to observable object
var viewModel = kendo.observable(model);
// bind the model to the container
kendo.bind($("#renderform"), viewModel);
}
});
</script>
- Pfosten-/Put api wird wie
url: crudServiceBaseUrl + "FormItemsDesign
type:Post
type:Put
bitte helfen Sie mir, wie man/ajax Funktion verwenden, um Post/Put anzurufen Speichern/Aktualisieren der Daten nach jedem dynamischen Feld in der Datenbank. Ich danke Ihnen im Voraus für Ihre wertvolle Zeit und Mühe.