Read object

After saving the object we would like to call it back and present it on our page. To do so we will use the 

objectId  of the record which is in our example "uD3KzzDd2b".  Keep in mind that all  objectId are unique values, so if you are following the steps please copy your objectId from your table.

In order to retrieve our object we are going to use the Simbla.query   that we will explain more about in our next guide.


We wish to present our final result on our page using our HTML element. Here is our HTML code:

<div Style="padding:30px;border:1px solid red">
   <H1 Id="cmodel"></H1></br>
    <h3 id="cyear"></h3></br></br>
    <p id="ccode"></p></br></br>
</div>   
   

   



Our Javascript code retrieving the record:

var car = Simbla.Object.extend("Cars");
var query = new Simbla.Query(car);
query.get("qxFYhsu14o", {
   success: function(car) {

$("#cmodel").html(car.get("car_model"));
$("#cyear").html(car.get("car_year"));
$("#ccode").html(car.get("car_code"));
     
    },
     error: function(car, error) {

   alert("Error - The object was not retrieved successfully" + error.message);
   
   
  }
});

To retrieve values from Simbla.object , use the get method:

var cyear= car.get("car_year");
var ccode= car.get("car_code");
var ccolor= car.get("car_color");
var cmodel= car.get("car_modle");

The three reserved values are provided as properties and cannot be retrieved using the 'get' method nor modified with the 'set' method:

var objectId = car.id;
var updatedAt = car.updatedAt;
var createdAt = car.createdAt;

About Simbla

Trying to create a website for their own business, Simbla's founders recognized, over the years, a lack of excellent, simple tools available on the market. Therefore, in 2013 Simbla was founded, for the purpose of providing a smart and easy website building solution for all types of businesses. Simbla's founders have more than 15 years of experience with web-based platforms and website building. We are helping SMB's to create a web presence and to evolve easily into a highly competitive market.

In our vision Simbla creates a new environment where websites are meant for everybody!

Social

all rights reserved to simbla inc

2016