mercredi 5 juillet 2017

change the width of coloumn in the excel sheet via export excel in kendo

i m using kendo grid in my ember app. i have introduced export to excel in the kendo. but after downloading the excel sheet i want to resize the width of the coloumn within the excel sheet .. how to deal with it--

here is my code--

 myGrid.bind("excelExport", function (e) {
                               // console.log(">>"+);
                               var str = e.sender.columns;
                               var title = str.map(function(d) { return d['title']; }).indexOf('Action');
                               var documentKey = str.map(function(d) { return d['field']; }).indexOf('documentKey'); 
                               if (!exportFlag) {  
                                e.sender.hideColumn(documentKey);
                                e.sender.hideColumn(title);
                                e.preventDefault();

                                exportFlag = true;
                                setTimeout(function () {
                                    e.sender.saveAsExcel();
                                 });
                                } else {
                                    e.sender.showColumn(documentKey);
                                    e.sender.showColumn(title);
                                    exportFlag = false;
                                }
                               }); 




Aucun commentaire:

Enregistrer un commentaire