Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

load data table app script

function getData(){
   var data = SpreadsheetApp.openById('YourSheetID').getSheetByName('YourSheetName').getDataRange().getValues();
   return data;
}
Comment

load data table app script

    <script type='text/javascript'>
    $(document).ready(function(){
        var runner = google.script.run.withFailureHandler(onFailure);
        runner.withSuccessHandler(onSuccess).getData();
    });
    var onSuccess = function(data){
        var aDataSet = data.slice(1);  // all except header


        var head = [];  // headers
        data[0].forEach(function(e){
            head.push({'sTitle': e});
        });

        $('#demo').html( '<table cellpadding="0" cellspacing="0" border="0" class="display" id="example"></table>' );
        $('#example').dataTable( {
            "aaData": aDataSet,
            "aoColumns": head
        });
    }
    var onFailure = function(err){
        alert(err.message);
    }
    </script>
Comment

PREVIOUS NEXT
Code Example
Javascript :: jest visit a page 
Javascript :: _onResize vue leaflet 
Javascript :: how to write to and read from text files line by line using javascript 
Javascript :: working with binary and base64 data 
Javascript :: find smallest interval in array javascript 
Javascript :: angular set dist output directly under dist rather than dist/project 
Javascript :: mongoose wont update value in array 
Javascript :: why does it say require is not defines 
Javascript :: nodejs validate bnb wallet address 
Javascript :: get all visible text on website javascript 
Javascript :: liste des mois javascript 
Javascript :: check presense of nmber in a string javascript 
Javascript :: Insert javascript variable into html string 
Javascript :: special mc seed -131245679982 and 982652008272 April 23, 2021 
Javascript :: sum of array odd number javascript 
Javascript :: feathersjs quicstart 
Javascript :: bad site theme 
Javascript :: jquery clear chozen 
Javascript :: conflict paypal api javascript with user agent Mozilla/5.0 Google 
Javascript :: how to detect if app is loosing focuse in react native 
Javascript :: change windlow location relitave to current one 
Javascript :: dynamic select paragraph id using javascript 
Javascript :: tools to extract javascript from the page 
Javascript :: json2csv parse with flatten example javascript 
Javascript :: json decoding and optionals 
Javascript :: jquery on load vs ready 
Javascript :: dropdown using ajax and django 
Javascript :: scripthelpers 
Javascript :: node code comment process real time 
Javascript :: gatsby underline link if page is active 
ADD CONTENT
Topic
Content
Source link
Name
6+9 =