admin管理员组

文章数量:1325321

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

var people = new Lawnchair('people');

var groups = new Lawnchair('groups');

This does not pletely work, it tries to copy contents from the people table to the group table. I have tried setting people.adapter.table on the fly which also results in a similar issue. I'm beginning to think it is not possible to have more than one table with Lawnchair..

Any help?

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

var people = new Lawnchair('people');

var groups = new Lawnchair('groups');

This does not pletely work, it tries to copy contents from the people table to the group table. I have tried setting people.adapter.table on the fly which also results in a similar issue. I'm beginning to think it is not possible to have more than one table with Lawnchair..

Any help?

Share Improve this question edited May 11, 2011 at 17:34 Daniel A. White 191k49 gold badges379 silver badges465 bronze badges asked Apr 1, 2011 at 2:46 gmreburngmreburn 412 bronze badges 1
  • 4 put the tables together and place the lawnchair in the middle. don't forget to wear sunscreen. – pixelbobby Commented May 11, 2011 at 17:34
Add a ment  | 

5 Answers 5

Reset to default 8

You should set the 'name' option on your Lawnchair instances:

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

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

-Marc

try older Lawnchair JavaScript Lawnchair library.. stored as same "table"?

I've never used Lawnchair, but it appears to be serializing your objects to JSON which doesn't support references. You might need to convert your objects to some intermediate form (i.e. replace the "people" reference with its key. Then, after you read it, you could use the key to get the object back.

Lawnchair is a cross mobile device key-value data store that insulates you from worrying about what platform your code is on.

You are trying to bend LawnChair in to doing something that it isn't designed to do.

You need to do full HTML5 database SQL.

And also be noted that, use adapter as 'dom' if you have no specific adaptor, sometimes Lawnchair will use window-name adapter as default adaptor, which have some problems with multiple table scenario.

本文标签: javascriptHow do I use Lawnchair with more than one tableStack Overflow