GDB Model -> View Example

Ms. Trunchbull

Red
Blue
Orange

Male
Female
Other
Press the above button to change the data in the model which in turn is reflected in the view.

Model Data Structure

(Note: Because model updates are in realtime and the syntax highlighter is processor intensive, rapid input may slow this example. This behavior is not present in the production use of the plugin)

HTML

JavaScript

var model={
    name: "Ms. Trunchbull",
    email: "",
    password: "",
    bio: "",
    colors: ["blue"],
    gender: "male",
    language: "english",
    languages: ["spanish","italian","chinese"]
};

GDB({profileData: model});

$('#changeModelBtn').click(function(){
    model.name="Matilda";
    model.email="john@example.com";
    model.password="examplePassword123";
    model.bio="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris quis ultrices mi, vitae ultricies justo.\n Sed bibendum tempor lacus eget varius. Vestibulum ante ipsum primis.";
    model.colors=["red","orange"];
    model.gender="female";
    model.language="spanish";
    model.languages=["russian","french","english"];
});