Estoy agregando una función de exportación a Excel a una página web ya existente (y funcional).
El JavaScript para exportar mi RadGrid:
function onRequestStart(sender, args) { if (isExporting) { args.set_enableAjax(false); } } function exportToExcel(sender, args) { console.log("Made it here!"); isExporting = true; var masterTable = $find('<%= MyGrid.ClientID %>').get_masterTableView(); console.log(masterTable); masterTable.exportToExcel(); console.log(masterTable.exportToExcel()); isExporting = false; }El RadGrid que se crea proviene de un archivo JS separado, por lo que no estoy seguro de qué mostrar aquí, excepto la línea de creación de radgrid, supongo. El archivo en el que existe todo este código es un archivo .aspx.
<telerik:RadGrid ID="MyGrid" runat="server" AutoGenerateColumns="false" Width="100%" Height="100%" AllowSorting="true"> <ClientSettings EnablePostBackOnRowClick="false> <Scrolling AllowScroll="true" UseStaticHeaders="true" /> <Selecting AllowRowSelect="true" /> <ClientEvents OnCommand="function(sender,args) { myLibrary.mainGrid.onGridCommand(sender, args) }" OnRowDataBound="function(sender,args) { mylibrary.mainGrid.onRowDatabound(sender,args) }" OnRowClick="function(sender,args) { mylibrary.mainGrid.onRowClick(sender,args) }" onRowMouseOut="function(sender,args) { mylibrary.mainGrid.onRowMouseOut(sender,args)}"/> </ClientSettings> <MasterTableView CommandItemDisplay="None" ClientDataKeyNames="Cant share these :)" TableLayout="Auto" AllowPaging="true" PageSize="20"> ... fill out table with <NoRecordsTemplate>, <PagerStyle>, <Columns> </MasterTableView> </telerik:RadGrid>La cuestión:
Cuando se llama a mi función, registro cosas para ver qué sucede en el interior...
¿Por qué se muestra falso para una variable que parece contener información importante?