Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

openCursor() Issue #60

Open
neerajjoshi opened this issue Dec 16, 2013 · 0 comments
Open

openCursor() Issue #60

neerajjoshi opened this issue Dec 16, 2013 · 0 comments

Comments

@neerajjoshi
Copy link

Hello Team,

I using IndexedDBShim.min.js and jquery.indexeddb.js in project for storing client data on local storage . The add and show data is working fine but I am unable to apply cursor query on it . Below is my code in typical indexed db structure and I want it to change as per jquery.indexeddb.js. Please help me how to change it according to jquery.indexeddb.js wrapper.

var transaction = db.transaction(["users"], "readonly");
var objectStore = transaction.objectStore("users");
var index = objectStore.index("tags");

        var rangeTest = IDBKeyRange.only(tag);
        index.openCursor(rangeTest).onsuccess = function(e) {
        var cursor = e.target.result;
        if (cursor) 
        {
            s += "<h2>Key "+cursor.key+"</h2><p>";
            for(var field in cursor.value) {
            s+= field+"="+cursor.value[field]+"<br/>";
            }
            s+="</p>";
            cursor.continue();
        }

As I am getting continuous error of openCursor() is not a function

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant