Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6787091
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:19:28+00:00 2026-05-26T17:19:28+00:00

I am working in chrome extension, I want to make paging for table which

  • 0

I am working in chrome extension, I want to make paging for table which is fill dynamically using sqlite queries.

I am using this tutorial to make the paging and make some modification in init function

http://en.newinstance.it/2006/09/27/client-side-html-table-pagination-with-javascript/

When I want to get the length of the table after filling it, the dom seems to be not ready and the result return as ZERO of table length, here’s some of my code..

function ViewAllNotes(db){
 var allListItems;   
  var cur = fromDateToString(new Date(),"date");

       db.transaction(function(tx) {
        tx.executeSql("SELECT NOTE_DESC,NOTE_DATE,NOTE_TIME FROM NOTES where NOTE_DATE = ? order by NOTE_TIME desc ",[cur],function(tx,result){
             alert(result.rows.length);

           for(i=0;i< result.rows.length;i++){
                 tr= "<tr>";
                 tr=tr+ "<td>"+ result.rows.item(i)['NOTE_DESC']+"</td>";
                  tr=tr+ "<td>"+ result.rows.item(i)['NOTE_TIME']+"</td>";
                 tr=tr+ "</tr>";
                allListItems+=tr;

            }


            var tableContent= " <thead><tr><th id='activityHeader'>Activity</th> <th>Time</th></tr></thead>";
            tableContent = tableContent+"<tbody>"+allListItems+"</tbody>";

            $("table#notes").append(tableContent);
                //$('#notes').dataTable();
                },onError);

        }); 

    }

EDIT
At the begining of the js file I make like this

ViewAllNotes(db);
var rows = document.getElementById("notes").rows;
alert("rows "+rows.length);

then call the pager class, but also it alerts with zero ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T17:19:28+00:00Added an answer on May 26, 2026 at 5:19 pm

    SQL calls are aysynchronous. Your code that tests for length will not have a length available until the SQL finishes and fires the callback.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a Chrome/Firefox extension which will be using the file API to
I'm working on a chrome extension, which use asynchronous functions, and I have a
I'm am working on a little chrome extension which uses the contextMenu to add
I am using this AutoCopy chrome extension as a framework for what I hope
I'm working on porting a Chrome extension to Firefox using the Firefox Add-on SDK.
I am working on the following code for a chrome extension. Basically I want
I am working on creating a Google Chrome extension. We have it included in
Guys check this website on FF and Chrome For some reason(s), jQuery isn't working
I am finding an issue which is specific with IE-7. Working on FF, Chrome,
I'm working on a chrome extension and I have a script that opens a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.