@shantanukumar847 thank You…it works. But I have some problems in code. on export function button458_click(event), “ime” is column in database, how to put code to import search data from query,its different for every search…
import wixData from ‘wix-data’
//For full API documentation, including code examples visit Velo API Reference - Wix.com
$w.onReady( function () {
//TODO: import wixData from ‘wix-data’;
});
export function searchButton_onClick(event) {
wixData.query(‘baza’)
.contains(‘jmbg’, $w(‘#jmbg’).value)
.find()
.then(res => {
$w(‘#table1’).rows = res.items;
});
}
$w.onReady( function () {
$w(“#table1”).columns = [{
“id”: “col1”,
“dataPath”: “ime”,
“label”: “Ime”,
“width”: 100,
“visible”: true ,
“type”: “string”,
}, {
“id”: “col2”,
“dataPath”: “prezime”,
“label”: “Prezime”,
“width”: 100,
“visible”: true ,
“type”: “string”,
}, {
“id”: “col3”,
“dataPath”: “brLicence”,
“label”: “licenca”,
“width”: 100,
“visible”: true ,
“type”: “string”,
}, {
“id”: “col4”,
“dataPath”: “idBroj”,
“label”: “ID broj”,
“width”: 100,
“visible”: true ,
“type”: “string”,
}, {
“id”: “col5”,
“dataPath”: “eMail”,
“label”: “E mail”,
“width”: 250,
“visible”: true ,
“type”: “string”,
}, {
“id”: “col6”,
“dataPath”: “jmbg”,
“label”: “jmbg”,
“width”: 100,
“visible”: true ,
“type”: “string”,
}];
});
export function button458_click(event) {
let toInsert = {
“ime”: “Ime”,
“prezime”: “Prezime”,
“idBroj”: “ID broj”,
“brojLicence”: “licenca”,
“eMail”: “E mail”,
“jmbg”: “jmbg”,
};
wixData.insert(“PrijavaPredavanja”, toInsert)
.then( (results) => {
let item = results; //see item below
} )
. catch ( (err) => {
let errorMsg = err;
} );
}