Git Product home page Git Product logo

Comments (4)

AMBudnik avatar AMBudnik commented on May 26, 2024

Hi @zhongguodong

Can you tell me a bit more about your use case?

When we go to the documentation for the setSortConfig method we can see that

Warn: Useful mainly for providing server side sort implementation (see in the example below). It doesn't sort the data set. It just sets sort configuration for all sorted columns. Note: Please keep in mind that this method doesn't re-render the table.

and this is how it works at the moment.

Reference: https://handsontable.com/docs/react-data-grid/api/multi-column-sorting/#setsortconfig

from handsontable.

zhongguodong avatar zhongguodong commented on May 26, 2024

Hi @AMBudnik
Haven't you noticed? The sort setting is successful, the title column is not sorted, the icon shows that setSortConfig is successful, you need to see the effect, but also adjust the size of the following appears, no display of the sorted rule.

from handsontable.

AMBudnik avatar AMBudnik commented on May 26, 2024

Ah yes, you are right - the arrow should appear without the need to resize the column.

Based on the documentation that I linked at https://handsontable.com/docs/react-data-grid/api/multi-column-sorting/#setsortconfig

beforeColumnSort: function(currentSortConfig, destinationSortConfigs) {
  const columnSortPlugin = this.getPlugin('multiColumnSorting');

  columnSortPlugin.setSortConfig(destinationSortConfigs);

  // const newData = ... // Calculated data set, ie. from an AJAX call.

  this.loadData(newData); // Load new data set and re-render the table.

  return false; // The blockade for the default sort action.
}

we call loadData(). However, that forces the plugin to reset so the arrows are not visible. (I will request that this example be altered.)

Now the table has to rerender to show an arrow. But we do not want the plugin to reset (it has to hold the sorting config) so instead of loadData() we need to call updateData().

Here is the demo for you to test https://jsfiddle.net/sj28q9cr/

Please let me know if it works for you.

from handsontable.

adrianszymanski89 avatar adrianszymanski89 commented on May 26, 2024

Issue closed due to inactivity.

from handsontable.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.