This is a migrated thread and some comments may be shown as answers.

excel feature and mvvm

9 Answers 340 Views
Grid
This is a migrated thread and some comments may be shown as answers.
David Ocasio
Top achievements
Rank 2
Iron
Veteran
Iron
David Ocasio asked on 04 Dec 2014, 05:42 PM
I am trying to use the excel export feature with a grid but the toolbar icon is not the one in the demos.
And it is not exporting (see snapshot).

Is there something obvious I am doing  wrong.

<script id="NodeViewTemplate" type="x-kendo-template">
     <div data-role="grid" id="grid1"
          data-scrollable="true"
          data-sortable="true"
          data-groupable="false"
          data-filterable="true"
          data-reorderable="true"
          data-resizable="true"
          data-row-template="NodeRowTemplate"
          data-alt-row-template="NodeAltRowTemplate"
          data-toolbar="['excel']"
          data-excel="fileName: 'Nodes.xlsx',
                      filterable: true"
         data-columns="[
         { field: 'statusimage' , width: 175 , title: 'Status'  },
         { field: 'idradio', width:100  , title: 'Device' },
         { field: 'peakCurrent',width:100  , title: 'Peak' },
         { field: 'avgCurrent',width:100  , title: 'Average' },
         { field: 'dateupdated', width:200 , title: 'Last Updated' },
         { field: 'nextupdate', width:200 , title: 'Next Update' },
         { Command: ['edit'] , width:150 , title: ''},
         ]"
         data-bind="source: Nodes, visible: isVisible">
     </div>
 </script>

9 Answers, 1 is accepted

Sort by
0
Accepted
Robert
Top achievements
Rank 1
answered on 05 Dec 2014, 09:47 PM
Try adding this to the page header
    <script src="http://cdnjs.cloudflare.com/ajax/libs/jszip/2.4.0/jszip.min.js"></script>
0
Accepted
Kiril Nikolov
Telerik team
answered on 08 Dec 2014, 11:57 AM
Hello David,

The following example seems to work, maybe I missed something?

http://dojo.telerik.com/awEvo

Regards,
Kiril Nikolov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
David Ocasio
Top achievements
Rank 2
Iron
Veteran
Iron
answered on 08 Dec 2014, 02:32 PM
Thank you gentleman,

The problem was indeed that I did not have the jszip file linked in the header.
The Icon did not show because of caching on the browser.

again thanks
dco
0
Haider
Top achievements
Rank 1
answered on 14 Jun 2016, 11:00 PM

can i have the same behavior via onclick event ? I need to add one more button at the top of the page that the user can click to export the grid result for excel.. how to do that?

 

0
Kiril Nikolov
Telerik team
answered on 15 Jun 2016, 07:16 AM
Hello,

You can export the dataSource manually using the following approach:

http://docs.telerik.com/kendo-ui/framework/excel/extract-datasoruce

In case you have any further questions, please open a separate support request and we will be happy to help.

Regards,
Kiril Nikolov
Telerik
 
Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
 
0
Haider
Top achievements
Rank 1
answered on 16 Jun 2016, 03:36 PM

Thank You Kiril, This is working fine for me...

0
Kiril Nikolov
Telerik team
answered on 17 Jun 2016, 06:54 AM
Hello,

Excellent!

In case you have any further questions do not hesitate to contact us.

Regards,
Kiril Nikolov
Telerik
 
Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
 
0
Haider
Top achievements
Rank 1
answered on 30 Jun 2016, 08:41 PM

Hi there..

Exporting the dataSource using the approach mentioned above will only export the first page int the grid, how to use "allPages" option within the same scenario?

Thanks 

0
Kiril Nikolov
Telerik team
answered on 01 Jul 2016, 07:27 AM
Hello,

I suppose you have serverPaging enabled? In that case the data is not present on the client, so you need to fetch all the data on the client before exporting it.

Regards,
Kiril Nikolov
Telerik
 
Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
 
Tags
Grid
Asked by
David Ocasio
Top achievements
Rank 2
Iron
Veteran
Iron
Answers by
Robert
Top achievements
Rank 1
Kiril Nikolov
Telerik team
David Ocasio
Top achievements
Rank 2
Iron
Veteran
Iron
Haider
Top achievements
Rank 1
Share this question
or