I am using "backendless.com" as a BaaS, what I need is to get data from table. Here I am saving object to table:
function Products(args) {
args = args || {};
this.name = args.name || "";
this.quantity = args.quantity || "";
this.price = args.price || "";
}
function sendData () {
var age = document.getElementById("age").value,
name = document.getElementById("name").value,
title = document.getElementById("title").value;
var requestObject = new Products( {
name: name,
quantity: quantity,
price: price,
});
var savedRequest = Backendless.Persistence.of( Products ).save( requestObject );
}
This is my index.html file:
<form onsubmit="sendData()">
<input type="text" placeholder="name" id="name"><br>
<input type="text" placeholder="quantity" id="quantity"><br>
<input type="text" placeholder="price" id="price"><br>
<input type="submit" value="Submit">
</form>
After that, when object was saved to table, I want to call this object, and put it to my table (after clicking submit button): like that
How should I do that?
The result of the following API call:
Backendless.Persistence.of( Products ).save( requestObject )
that is the value you put into the savedRequest variable IS the actual saved object. You should be able to use the object in that variable to render it in your UI.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With