How to use Lawnchair with more than one table?

I am trying to use Lawnchair (http://westcoastlogic.com/lawnchair/) for a mobile project to store information about different things. I need to store more than in a table.

var people = new Lawnchair('people'); var groups = new Lawnchair('groups'); 

This does not work completely, it tries to copy the contents from the people table to the groups table. I tried setting people.adapter.table on the fly, which also leads to a similar problem. I am starting to think that it is not possible to have more than one table with Lawnchair.

Any help?

+4
source share
5 answers

You must set the name option in your Lawnchair instances:

 var people = new Lawnchair({name: "people"}, function(){}); var groups = new Lawnchair({name: "groups"}, function(){}); 

-Marc

+8
source

I have never used Lawnchair, but it seems to serialize your objects in JSON, which does not support links. You may need to convert your objects to some kind of intermediate form (for example, replace the people link with your key. Then, after reading it, you can use the key to return the object.

0
source

Lawnchair is a mobile-key databank that isolates you from worrying about which platform your code is on.

You are trying to bend LawnChair to do what it is not intended to do.

You need to make a complete HTML5 SQL database.

0
source

It should also be noted that using the adapter as "dom", if you do not have a specific adapter, sometimes Lawnchair will use the window name adapter as the default adapter, which has some problems with several table scripts.

0
source

Source: https://habr.com/ru/post/1346162/


All Articles