Giter Site home page Giter Site logo

Comments (7)

danielo515 avatar danielo515 commented on July 24, 2024

oK, I found the solution.

You have to pass the insert method an object, indicating what to insert, and optionally where. To be honest I'm not sure what properties are mandatory and what parts are not. Can I provide just the where property?

For those interesthed, this is how the call sholud look like:

.trigger ("insert",{ what:{name:"Col"+data.columns.length},where:1e6}); 

This is a bit un-intuitive and it should be mentioned in docs at some place.
PD: What the hell 1e6 means?
Regards

from jquery.my.

ermouth avatar ermouth commented on July 24, 2024

This is a bit un-intuitive and it should be mentioned in docs at some place.

It is mentioned – http://jquerymy.com/api.html#CW-repeated-c. Please, use API reference at the project‘s site, not Github version. Github version is not full – it‘s rather hard to maintain all three versions of docs, especially taking in account Github does not allow code snippets. Thats why I specially pointed at the start of Github one, that there exist more detailed API ref.

Both what and where are optional. 1e6 is position where to insert, large nums insert at the end of list.

First of all thank you for this awesome library.

Thank you )

from jquery.my.

ermouth avatar ermouth commented on July 24, 2024

To add – you can insert section using jQuery syntax, see http://jquerymy.com/api.html#CW-controls-c

from jquery.my.

danielo515 avatar danielo515 commented on July 24, 2024

Hello @ermouth

I was reading the docs page of jquerymy.com. And I read that section. But there is no clear reference on it about the fact that if you do not specify what to insert, then nothing is inserted. The only thing that makes you think that is this sentence .

Sparse arrays are not supported, so {where:1e6} inserts row at the end of the list.

I did not know what sparse arrays are, so I searched it. Sparse arrays are arrays with identical values appearing more than once, so I guess that if you try to insert an empty object and there is already one, then you are not allowed to insert it. Please correct me if I'm wrong. The problem is that, if you don't understand that term (I'm not native English), you will not even think that it is the key of your problem.

I also want to thank and congratulate you for cloudwall, another awesome piece of software. It reminds me (in some way) to tiddlywiki. Is there any mailing list or official forum? (sorry for hijacking this ticket, but I did not want to open another one just for this)

Thank you.

from jquery.my.

ermouth avatar ermouth commented on July 24, 2024

Just read Wiki about sparse array – definition is surely bit confusing. Sparse array for JS is an array, where some indexes has no value (undefined). Like:

var a = []; a[0] = 1; a[100]=2;

I‘ll improve manual to make it more clear, thanks for pointing it out. Is formulae Each member of an array must be an object, and it‘s a good practice to make each member unique is more clear?

Also I gonna describe .where property more precisely.

if you do not specify what to insert, then nothing is inserted

Also good point. In fact in this case $.my inserts .data section of a default child manifest, if any.

Is there any mailing list or official forum [for cloudwall]?

No, not yet. It‘s not so popular ) In fact, I do not want to propagate cloudwall widely right now. Reason is default underlying low-level storage (IDB) is full of bugs in Chrome. Moreover, guys from Chrome add new bugs in literally every major release. Yes, they fix old bugs – but add new ones ((( It sometimes cause severe errors and even attachments loss if you are not synced with remote CouchDB.

So I just don‘t want to be responsible for Google bugs.

Surely, guys from PouchDB (lib inside cloudwall that converts IDB to more robust and syncable storage) fight with Chrome IDB bugs more or less successfully. Nevertheless I do not want to propagate software, that can accidentally discard user‘s data after browser update. Hate Chrome and IDB for this, especially taking in account IDB is born inside Google.

In fact, cloudwall.me is much more reliable (and sometimes more fast!) in Safari+WebSQL on iPad for example, then in Chrome+IDB.

So please, be patient. I see growing pressure on Chrome team from community, so I think they‘ll be more inspective testing IDB before releasing new versions of Chrome.

I'm not native English

I‘m also not.

from jquery.my.

danielo515 avatar danielo515 commented on July 24, 2024

var a = []; a[0] = 1; a[100]=2;
I‘ll improve manual to make it more clear, thanks for pointing it out. Is formulae Each member of an array must be an object, and it‘s a good practice to make each member unique is more clear?

Yes, it is more clear. Thank you very much.

Also I gonna describe .where property more precisely.

Good idea

if you do not specify what to insert, then nothing is inserted

Also good point. In fact in this case $.my inserts .data section of a default child manifest, if any.
Yes, it inserts it first time, until you click it again. Then nothing happens.

Now I'm feel lucky of using cloudwall in Firefox!!!
And is there any mailing list or something similar for jquerymy? I'm experiencing some problems with modals and I would love to ask about it.

from jquery.my.

ermouth avatar ermouth commented on July 24, 2024

Yes, it inserts it first time, until you click it again. Then nothing happens.

Because you‘re trying to create a full duplicate – $.my can not distinguish duplicates and assume it‘s a single item. If you modify already inserted item somehow and then insert new one – it must appear.

Good approach is to add something like id property into child section and put Date.now() into it to guarantee you have no dups even if you did not modified item.

And is there any mailing list or something similar for jquerymy?

No, sorry, and I do not plan to. Feel free to raise new issues here, but please label them as question if it‘s a question.

from jquery.my.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.