We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How refresh or add DataSource in loadComplete?

Thread ID:





128098 Jan 2,2017 01:29 PM UTC Jan 4,2017 06:15 AM UTC JavaScript 3
Tags: ejSpreadSheet
Oscar Montesinos
Asked On January 2, 2017 01:29 PM UTC

Hello, I have a ejSpreedSheet and I open it perfectly, but I need change or add one dataSource to Sheet number 1, I released this code:

                                    allowInsert: true,
                                                allowExporting: true,
                                                excelUrl: eg3Config.Url + "api/JSXLExport/ExportToExcel",
                                                csvUrl: eg3Config.Url + "api/JSXLExport/ExportToCsv",
                                                pdfUrl: eg3Config.Url + "api/JSXLExport/ExportToPdf"
                                    allowImport: true,
                                    importSettings: {
                                        importMapper: eg3Config.Url + "api/JSXLExport/Import?file="+newfile,
                                        importUrl: "http://prueba"
                                    loadComplete: function (args) {
                                        var xlObj = $("#container").data("ejSpreadsheet");
                                        xlObj.clearRangeData("A7:P15","" , null, true);
                                        var sheet=xlObj.getSheet(1);            

but refreshContent don't refresh data in sheet.

best regards
Oscar Montesinos

Silambarasan I [Syncfusion]
Replied On January 3, 2017 11:12 AM UTC

Hi Oscar, 
Thank you for using Syncfusion products. 
We have checked your reported query and we would like to let you know that using ‘updateRange()’ client-side method allows to update the range of cells with specified rangeSetting in Spreadsheet. So, we suggest you to use ‘updateRange()’ to achieve your requirement “To change or add dataSource to Sheet 1”.  Please refer the below modified code example. 
var dataSource = [ 
    loadComplete: function (args) { 
        //var xlObj = $("#container").data("ejSpreadsheet"); 
        var xlObj = this, settings; 
        xlObj.clearRangeData("A7:P15", "", null, true); 
        settings = { dataSource: dataSource, showHeader: false, startCell: "A4" }; 
        // To update range of cells with the specified settings 
        xlObj.updateRange(1, settings); // 1 => Sheet Index 
For your convenience, we have prepared a sample to demonstrate this and the same can be downloaded from the following location, 
Silambarasan I 

Oscar Montesinos
Replied On January 3, 2017 11:30 AM UTC

Hello, thanks a lot, it works fine

Silambarasan I [Syncfusion]
Replied On January 4, 2017 06:15 AM UTC

Hi Oscar, 
Thanks for your update. 
We are happy to hear that your requirement has been achieved.  Kindly get back to us if you need further assistance.  We will be happy to help you out. 
Silambarasan I 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon