Spreadsheet with Remote data & Sorting

11 posts, 0 answers
  1. Marc
    Marc avatar
    171 posts
    Member since:
    Sep 2016

    Posted 28 Feb 2017 Link to this post

    I have a spreadsheet, with a datasource which retches remote data. When I sort the spreadsheet and edit row 2 (which was originally row 100), the datsource thinks that I have edited row 100. Is there a solution to this?

    Marc

  2. Veselin Tsvetanov
    Admin
    Veselin Tsvetanov avatar
    1201 posts

    Posted 02 Mar 2017 Link to this post

    Hello Marc,

    Currently the Spreadsheet widget does not support sorting or filtering, while editing data of a Sheet bound to remote DataSource. The reason for that is the fact, that editing of items relies on their ordered index on the client, which should match the index on the server.

    Regards,
    Veselin Tsvetanov
    Telerik by Progress
    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.
  3. Marc
    Marc avatar
    171 posts
    Member since:
    Sep 2016

    Posted 02 Mar 2017 in reply to Veselin Tsvetanov Link to this post

    Hi Veselin,

    Are there any plans to implement this? I see it is quite a large bug.

    Marc

  4. Marc
    Marc avatar
    171 posts
    Member since:
    Sep 2016

    Posted 03 Mar 2017 in reply to Veselin Tsvetanov Link to this post

    Hi Veseline,

    I'm confused why this isn't implemented. Could you not just (in the spreadsheet sort & filter events) use the .sort and .filter method of the datasource to keep them synchronised?

  5. Veselin Tsvetanov
    Admin
    Veselin Tsvetanov avatar
    1201 posts

    Posted 06 Mar 2017 Link to this post

    Hi Marc,
     
    The sort and filter functionality of a databound Spreadsheet Sheet is currently not supported because of the internal implementation decisions on the Spreadsheet widget. Note, that it would require the sort and filter state to be passed from the client to the server and to be applied to the DataSource server-side. Also, its implementation is not included in our near future plans.

    In case, that you think such functionality would add considerable value to the Spreadsheet widget, I would suggest you to post a feature request in our Feedback portal. Based on the support it receives from the community, we will make our decision whether to proceed with its implementation or not.

    Regards,
    Veselin Tsvetanov
    Telerik by Progress
    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.
  6. Marc
    Marc avatar
    171 posts
    Member since:
    Sep 2016

    Posted 06 Mar 2017 in reply to Veselin Tsvetanov Link to this post

    Hi Veselin,

    I do not understand what you're saying. In my js file (It's an AngularJS controller), I have a datasource object and a spreadsheet component. When I change the sort or filter inside the spreadsheet, couldn't the sort/fitler events of the spreadsheet be used, to fire a .sort or .filter method on the datasource, to ensure the correct row is updated in the datasource client side?

    Thanks

    Marc

  7. Marc
    Marc avatar
    171 posts
    Member since:
    Sep 2016

    Posted 06 Mar 2017 in reply to Veselin Tsvetanov Link to this post

    Is there an event which is fired (which I can access) when the spreadsheet is sorted? Or is there a way to disable the sort options inside the filtermenu object of the spreadsheet?

    Thanks,

    Marc

  8. Veselin Tsvetanov
    Admin
    Veselin Tsvetanov avatar
    1201 posts

    Posted 08 Mar 2017 Link to this post

    Hello Marc,

    Answering to your questions:

    - The Spreasdheet widget does not expose sort / filter events, that could be handled. In addition, the DataSource of the Spreadsheet could be configured with remote source (transport actions as in our demo). In such scenario, the information of how the data is currently sorted / filtered should be sent to server along with the information about the deleted / inserted / updated entry. The data from the database should be sorted and filtered on the server and the appropriate item should be modified / deleted or created. This synchronization of the filtering / sorting of data between the client and the server is currently not supported by the Spreadsheet and the DataSource objects;

    - As I mentioned, there is no event that would be fired, when the data in the Sheet is sorted. However, you could simply remove the filter tool from the toolbar by manually specifying the included tools in the Home tab. Here you will find a simple Dojo sample, demonstrating the above.

    Alternatively, if you need to hide only the sort section in the filtering menu, you could do that by using CSS:
    .k-spreadsheet-filter-menu li[data-command="sort"] {
      display: none;
    }

    Regards,
    Veselin Tsvetanov
    Telerik by Progress
    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.
  9. Marc
    Marc avatar
    171 posts
    Member since:
    Sep 2016

    Posted 08 Mar 2017 in reply to Veselin Tsvetanov Link to this post

    Hi Vaselin,

    I understand the issues here. The problem I have is that I am not using the datasource for the webservice URL's. I have a webservice which returns a value. The value is held inside $scope.myresults. I then use the datasource read function as below:

    transport: {
    read: function (options) {
    options.success($scope.myresults);
    }

    }

    I do not show the Home tab, so I cannot remove the filter menu. Our users want to be able to filter & sort, but this means that to save the data we must use the spreadsheet.range method, and manually find changed records, and manually create objects to pass to the back end.

    Thanks for the information about hiding the sort options.

    Marc.

     

     

  10. Veselin Tsvetanov
    Admin
    Veselin Tsvetanov avatar
    1201 posts

    Posted 10 Mar 2017 Link to this post

    Hi Marc,

    I am afraid, that at the current moment the combination of DataSource binding + sorting / filtering remains unsupported by the widget. Therefor, to manually alter the changed values remains the only option in this scenario.

    Regards,
    Veselin Tsvetanov
    Telerik by Progress
    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.
  11. Marc
    Marc avatar
    171 posts
    Member since:
    Sep 2016

    Posted 10 Mar 2017 in reply to Veselin Tsvetanov Link to this post

    No problem - thanks for all the help!

    The solution to hide the sort menu did not work, I have fixed it using the below, just for anyone else who may need it:

    .k-spreadsheet-filter-menu ul li[data-command="sort"] {
    display: none;
    }

Back to Top