Update object

Updating an object is actually saving over the old object, in the next example we are going to use our "WY0DQyj9L6 " record, remember that each record is unique so please check your record before testing it out.

We are basically getting the "WY0DQyj9L6" record, setting new info and saving it:

var car = Simbla.Object.extend("Cars");
var query = new Simbla.Query(car);
query.get("WY0DQyj9L6", {

    success: function(car) {
      car.set("car_year", 2016);
      car.set("car_model", "new car");

        car.save(null, {
            success: function(car) {
                 alert("Update succeeded") ;
            },
            error: function(car, error) {
                 alert("Error - update failed" + error.message);
            }
        });
   },
   error: function(car, error) {
      alert("Error - The object was not retrieved successfully" + error.message);
   }
});

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