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

Selecting Filtered Data

1 Answer 10 Views
Spreadsheet
This is a migrated thread and some comments may be shown as answers.
Neil
Top achievements
Rank 1
Neil asked on 31 May 2017, 09:22 PM

Is there a json/jscript function to select the filtered data when using the spreadsheet. I'm trying to find a way to limit the data that has to get serialized when I'm doing updates. Here's my Save function. I'm looking for a way to potentially replace the spreadsheetData with the filtered data set instead of the entire bound data set.

function Save_onClick() {
        var staticNotification = $("#staticNotification").data("kendoNotification");
        staticNotification.show(" Updating data...");
        var dataSource = $("#spreadsheet").data("kendoSpreadsheet").activeSheet().dataSource;
        var spreadsheetData = dataSource._data;
 
        if (spreadsheetData) {
            $.ajax({
                type: "POST",
                url: '@Url.Action("Grid_Update", "Spreadsheet")',
                contentType: "application/json; charset=utf-8",
                data: JSON.stringify({ datum: spreadsheetData, moduleId: @Model.TheModule.Id }),
                dataType: "json",
                success: function (result) {
                    if (result.status == "Success") {
                        $(".validation-summary-valid").text(result.message);
                        staticNotification.hide();
                    } else {
 
                    }
                }
            });
        }
    }

 

Thanks,

Neil

1 Answer, 1 is accepted

Sort by
0
Ianko
Telerik team
answered on 02 Jun 2017, 12:44 PM

Hello Neil,

I suppose the data of the Spreadsheet is filtered using a filter element in the sheet. If this is the case, this filter, only visually filters the data. Applying it, does not actually remove any data so to be not present when returned from the _data property or the toJSON method

Generally, this filter works only visually. It is a major requirement for the rest of the data to be present so that when the filter is reset, the old data to be shown again. If it is to be entirely wiped from the sheet's view, the user will be incapable of re-filtering or resetting the data. 

Regards,
Ianko
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Spreadsheet
Asked by
Neil
Top achievements
Rank 1
Answers by
Ianko
Telerik team
Share this question
or