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

Column binding/ordering not working

1 Answer 112 Views
Spreadsheet
This is a migrated thread and some comments may be shown as answers.
Kevin
Top achievements
Rank 1
Kevin asked on 02 Sep 2016, 10:11 PM

My spreadsheet loads fine, but the order in which it loads the columns is odd based on the datasource I'm pulling from. I'd like to specify the order they're in, as well as the name of said columns.

 

I have the following code:

///////////////
                        $("#spreadsheet").kendoSpreadsheet({
                            columns: 17,
                            columnWidth: 100,
                            rows: 100,
                            
                            toolbar: true,
                            sheetsbar: true,
                            excel: {                
                                // Required to enable Excel Export in some browsers
                                proxyURL: "//demos.telerik.com/kendo-ui/service/export"
                            },
                            sheets: [{
                                name: "Summary",
                                dataSource: summaryDS
                                
                            },{
                                name: "Customers",
                                dataSource: customersDS,
                                    columns: [
                                        {
                                            field: "nummer",
                                            title: "Number"
                                        },
                                        {
                                            field: "ans",
                                            title: "Customer"
                                    }]
                                
                            },{
                                name: "Prospects",
                                dataSource: prospectsDS
                            },{
                                name: "Leads",
                                dataSource: leadsDS
                            }]
                        });
                    ///////////////

 

 

1 Answer, 1 is accepted

Sort by
0
Boyan Dimitrov
Telerik team
answered on 06 Sep 2016, 09:25 AM

Hello Kevin,

I am afraid that such functionality can not be achieved using the columns property of the sheet. My suggestion is to use the schema.parse of the DataSource in order to modify the server response and leave only the columns you want to display. 

Regards,
Boyan Dimitrov
Telerik by Progress
 
Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
 
Tags
Spreadsheet
Asked by
Kevin
Top achievements
Rank 1
Answers by
Boyan Dimitrov
Telerik team
Share this question
or