Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-03-2013, 07:46 PM   PM User | #1
runbunnyrun
New to the CF scene

 
Join Date: Dec 2012
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
runbunnyrun is an unknown quantity at this point
misoproject datasets - how do i get data into a html table or list?

I am reposting this question because my previous post appears blank.

I am using http://misoproject.com/dataset/ javascript to import data from a google spreadsheet.
This data is called var = ds
I have then made a subset of this called var = subset

How do I make the next step - getting this subset into a html table or jquerymobile list on the browser screen?

I can see the data in the console log. I have been trying document.write but I can't get it to work.

My project is to put a sports prediction competition I run with a few friends onto a mobile friendly website. So eventually I ai mto have multiple subsets that I can then place into different tables or lists.

Thank you for any advice you can give. I am a complete novice at this.

Here is my code.

Code:
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css" />
 <!--       <script src="/js/miso.ds.deps.min.0.4.1.js"></script>	-->
        <script src="http://cloud.github.com/downloads/misoproject/dataset/miso.ds.deps.ie.0.4.1.js"> </script>        
       
        <script src="http://code.jquery.com/jquery-1.8.2.min.js">
        </script>
        <script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js">
        </script>
    </head>
    <title>testing data feeds</title>
    </head>
    <body>
        <script language="javascript" type="text/javascript">
            var ds = new Miso.Dataset({
                importer: Miso.Dataset.Importers.GoogleSpreadsheet,
                parser: Miso.Dataset.Parsers.GoogleSpreadsheet,
                key: "0Ap-cOp8vqNpadG5GXzJsbmtRNlpObzhuRjIwanZfRWc",
                worksheet: "1"
            });
            _.when(ds.fetch()).then(function(){
                // create subset of just one row
                var subset = ds.rows(function(row){
                    return (row.Qcode === 201205);
                });
                
                console.log("Subset length", subset.length);
                console.log("Question number", subset.column("Qcode").data);
                console.log("Matt ", subset.column("Matt").data);
                console.log("Rob ", subset.column("Rob").data);
                console.log("Paul ", subset.column("Paul").data);
                console.log("Ross ", subset.column("Ross").data);
            });
        </script>
    </body>
</html>
runbunnyrun is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:59 PM.


Advertisement
Log in to turn off these ads.