Skip to content

add

adds an item to the store

function add(
// the item object
obj: object,
// the item position
index?: number
): id

id the item id

function addData() {
grid.add({
title: document.getElementById("title").value,
year: document.getElementById("year").value
},0)
}

also check the next samples:

Object can contain any properties:

mygrid.add({
some:"some string",
other:123,
complex:{
contain:"any",
content:"inside"
}
}, 0);