最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How do I use Lawnchair with more than one table? - Stack Overflow

programmeradmin1浏览0评论

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.

发布评论

评论列表(0)

  1. 暂无评论