Coder Social home page Coder Social logo

Comments (18)

gregnb avatar gregnb commented on August 17, 2024

Could you share the data set and options you used? I'll try to recreate this when I get some down time. Maybe post your repo on github if the information is not sensitive ?

from mui-datatables.

JordanKadish avatar JordanKadish commented on August 17, 2024

The info is sensitive but essentially I'm loading a json file into the program and then looping through each item adding it to the rows, and the columns are also being defined by what's in the json file. It all works, except the filter triangle. When I limit the number of entries from 6k to 15, it works perfectly. An example entry would be:
{
"A": "1",
"B": "9999999999999999",
"SHAPE": "circle",
"LOCATION": "USA",
"C": "xyz",
}

One issue my side is that I'm currently not correctly mapping location column heading to row in the filtering section (so the values are under the right column in the grid, but in the filter, A's values are under B's heading) but that's definitely something wacky on my side. The halting thing that's happening is, I want to only filter by location (as an example) and when I've set all the other filter headings to false, I click the triangle and it just loads forever. When I limit the number of entries to 15, it loads right away (albeit the "locations" are all numbers because A's values are mapping to location, which is my fault)

from mui-datatables.

gregnb avatar gregnb commented on August 17, 2024

Ok no problem. I think I can take it from here. I'll follow your structure and beef the data set up to 10,000 rows and look where the issues are. BTW does this happen in any browser you test? Which one are you using to round out this big report

from mui-datatables.

JordanKadish avatar JordanKadish commented on August 17, 2024

I'm using firefox on linux. I'm really new to react in general, so I'm not sure how helpful I can be though I'll try whatever you suggest

from mui-datatables.

JordanKadish avatar JordanKadish commented on August 17, 2024

Ah, forgot to mention I am using checkbox... Not dropdown. I think that could be the main issue

from mui-datatables.

gregnb avatar gregnb commented on August 17, 2024

Nah you're a huge help honestly this package is fairly new and I'm finally starting to get good big reports now. Having something in the test suite for large data sets is something I should've taken care of earlier so this will be good. I'll still on vacation so I'll try to get to it within next few days when I get some down time.

Thanks again

from mui-datatables.

JordanKadish avatar JordanKadish commented on August 17, 2024

Idk if I should make a new issue for this, but I'd also like to suggest that in your docs example, you make it as generic as possible. So instead of hard coding in stuff like a user database and column headings, perhaps write a mapping function that takes in a json file with a headings obj list and user db obj list, and then maps the user's data correctly to the heading fields of each created row. This makes your code easy to swap out and makes sense for the kind of use cases the library would work with.

Example:
//read in json file
for (var i = jsonData.colNames.length - 1; i >= 0; i--) {
columns.push({
name:jsonData.colNames[i],
options:{
//wantFilter contains a list of parameters we want to have the filter, also read in from json
filter: wantFilter.indexOf(jsonData.colNames[i]) > -1 ? true:false
}
});
}

That'd do your headings for you, then a mapping function like the one used here could work for rendering the table values correctly maybe
https://codesandbox.io/s/kwyy504y57
(This demo also contains those tick boxes per row people want)

from mui-datatables.

JordanKadish avatar JordanKadish commented on August 17, 2024

Related to this issue
Alright I've made it so every column appears in the filter section, and that correctly maps the uniques, and gets the correct data under each column (when using dropdown filtering). But if I choose to turn filtering off for certain headings, this misaligns which values go under the remaining headings in the filter. IE, if I leave Amount and Location on as filterable, their values in the dropdowns are correct. If I make Amount not filterable, when I click Location, the values for Amount are being listed. I'd also like to know how to sort the shown values under each heading in the filter box (when I click Location with the correct values showing, they aren't in any order)

from mui-datatables.

gregnb avatar gregnb commented on August 17, 2024

Ok, I would open another issue and title it maybe "improve examples documentation + JSON loader function" maybe? I still want to keep the first example a user sees very simple and brief but expanding the examples to show how to load in a JSON file or even creating a standard function to load that in are good suggestions

from mui-datatables.

gregnb avatar gregnb commented on August 17, 2024

@JordanKadish ok, I'll roll that into this. As of today there's no sorting in the filter list but it's easy to add so I'll make it an option that is on by default but if a user doesn't want a filter list to be sorted alphabetically then it'll be shown as is.

from mui-datatables.

gregnb avatar gregnb commented on August 17, 2024

Anyway, my plane is landing soon I'll look into this next couple of days

Uploading IMG_7946.JPG


from mui-datatables.

JordanKadish avatar JordanKadish commented on August 17, 2024

Cool, so just to summarise this (I went a bit off track sorry)
Sorting the filter list
Bug (possibly my side only) where hiding a column from the filter section shifts the listed values of all the other columns so heading X now has heading Y's row values

from mui-datatables.

gregnb avatar gregnb commented on August 17, 2024

Ok, I just published version 1.0.9. This will sort by default the filter list generated for each column. Also, there was a bug when the filter was turned off and did indeed shift the results. I took care of that bug so thanks for spotting it!

Let me know how it goes

from mui-datatables.

JordanKadish avatar JordanKadish commented on August 17, 2024

Thanks, I'll get back to you by tomorrow with results

from mui-datatables.

gregnb avatar gregnb commented on August 17, 2024

Hey @JordanKadish did you get a chance to try? I've tested again and it seems fine on my end

from mui-datatables.

JordanKadish avatar JordanKadish commented on August 17, 2024

Yeah thanks, tested and working. Great job! I'm going to be super busy for a while but when I can, I'll try pop up some generic json loader code for you to slot in somewhere

from mui-datatables.

gregnb avatar gregnb commented on August 17, 2024

@JordanKadish Thanks for reporting the bug! I'm still going to think about the JSON loader as a main feature. For sure I will include it as an examples/ but as for main feature I still need some time to decide

from mui-datatables.

JordanKadish avatar JordanKadish commented on August 17, 2024

@gregnb no worries, I just think most people won't be working with this framework on hardcoded data, that's all. I am sure there are multiple ways to load in data, json just seems to be the most common in my experience. Thanks for fixing the bug :)

from mui-datatables.

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.