mleibman / SlickGrid

A lightning fast JavaScript grid/spreadsheet
http://wiki.github.com/mleibman/SlickGrid
MIT License
6.81k stars 1.98k forks source link

Grouping by substrings #1008

Open umdstu opened 10 years ago

umdstu commented 10 years ago

I want to be able to group a column into subgroups based on substrings of the values.

For example, column values are: 'abc-123-xyz', 'abc-123-xyy', 'abc-231-yyx', etc.

I want to first group by the first substring, abc, then group by the second substring, 123 and 231, then the last substrings.

For example,

Group: abc (3)
  Group: 123 (2)
    abc-123-xyz
    abc-123-xyy
  Group: 231 (1)
    abc-231-xyy

Now, I have created a groupBy() function that compares the substrings (after doing a .value.split('-')), which is fine. But regardless of how I do the comparisons, the view always displays the rows grouped by the full value, ie.

Group: abc-123-xyz (1)
Group: abc-123-xyy (1)
Group: abc-231-yyx (1)

Is this not possible, or does it require more modification of the slick.dataview.js functions, and not just what is done in the dataView.groupBy() function?

Thanks!

elmaike commented 10 years ago

Did you solve the issue?

umdstu commented 10 years ago

Unfortunately, no. I haven't had time to follow up on my intial attempts. It's still a ticket for my app so I will revisit it eventually. Have you?

elmaike commented 10 years ago

could you please write an example in jsfiddle so I can try to help you?

umdstu commented 10 years ago

Let me work on creating that fiddle for you, I would appreciate any help. Sorry for the delay, working multiple projects :)

umdstu commented 10 years ago

Here's a basic grouping example I've put together. Played with it for a while, not sure what direction I need to be headed in yet. I lost my original example I was working on a while back.

http://jsfiddle.net/pa3u1b8m/4/

elmaike commented 9 years ago

Ok, let me know when you have a working example to try to help you.

Regards.

2014-10-30 8:44 GMT-06:00 umdstu notifications@github.com:

Here's a basic grouping example I've put together. Played with it for a while, not sure what direction I need to be headed in yet. I lost my original example I was working on a while back.

— Reply to this email directly or view it on GitHub https://github.com/mleibman/SlickGrid/issues/1008#issuecomment-61103044.