insert

Inserts a new item at the specified index of the data list and returns an editable Model for it.

var dataSource = new shield.DataSource({
    read: "/get_all.php",
    modify: {
        create: "/handle_updates.php",
        update: "/handle_updates.php",
        remove: "/handle_updates.php"
    }
    schema: {
        fields: {
            Id: { path: "id", type: Number },
            Name: { path: "name", type: String }
        }
    }
});

// insert a new item at the beginning
dataSource.insert(0, { Id: ++max_id, Name: "New Item Name" });

// save the changes
dataSource.save();