Hi,
Can I request a sample javascript to properly insert a record in an idb table using database.js device table example as follows:
{ name: "device",
syncproc: "syncdevice",
objectStore:{},
everythingafter:0,
primarykeyfield: "guid",
timestampfield: "ts",
servertimestampfield: "sts",
deletedtimestampfield: "dts",
indexes: [
{name:'timestampkey',unique: false, fields:["ts"]},
{name:'servertimestampkey',unique: false, fields:["sts"]}
],
relations: [
],
record: {
guid:"",
ts:0,
sts:0,
dts:0,
syncurl:"",
mobileno:"",
email:"",
user_name:"",
password:"",
description:"",
lastsyncdate:"",
lastsynctime:"",
registered:0
},
I was thinking of doing it as follows but not so sure of the proper usage:
database.device."guid" = Math.random().toString(36).substr(3,8).toUpperCase() + Math.random().toString(36).substr(3,8).toUpperCase();
database.device."ts" = 0;
database.device."sts" = 0;
database.device."user_name" = ' Sample Name";
idbWrite(database,device,record,fromSync,oncomplete,onerror)
Thanks,
Vic