drop down filtering data - reactjs

I want to filter the data with a dropdown using useSWR. The sortedOptionList is hardcoded. Is there a way to make it more dynamic when calling the api?
https://codesandbox.io/s/weathered-wildflower-ousy1n?file=/src/App.tsx:0-1903

There is a useful package to do this task.
React Select

Related

I want to access filter data while searching in Material Table React - how to access or is there any method to access or triggered while searching

i am trying to update the data according to search filter in material table, i didn't find any method or param by which i access the data updated on search filter, i can call an api and provide search filter but it may slow down the query so i want to do it on frontend side.
i have tried the method above mentioned handleSearchChange which only give the search query nothing else, if i can get access the data of updated after searching in search field then i can do what i want
I have found an answer for the above query I have posted, the simple way to use the useRef in material table, by which you can access the current data of your table displaying.
tableRef={tableRef}
to access the data you can use
tableRef?.current?.state.data

React and tables

I want to display the data returned from an api in a tabular form.What is preferable:
Building a table from scratch and adding functionality like pagination, search and row select
or
Using already built in components like react-table or react-data-table-component, MDBDataTable, etc
My requirement is, I just want to show the data returned from an axios call and also should have functions like pagination, row-select and search. Also, which component is best which will solve my requirement
try this react table component ka-table https://komarovalexander.github.io/ka-table/#/overview
It has all required functionality. Works with both js and ts. And easy to start because of big set of demos

how can I do a search filter with keyword buttons popover in React?

Could anyone suggest me some tutorials or some suggestion how to perform the search function using multiple popover filter button. (instead of typing input , click on the filter buttons)?
Some think quick and easy to start to take a look and use filter and sort functions for example in a Table component could be this specific component in Ant design library`: https://ant.design/components/table/#components-table-demo-head
If you plan to implement the filter and sorter (a query to a collection of data) logic in the front-end and you plan to have multiples filters applayed at the same time you can take a look of this library: https://github.com/crcn/sift.js
If you plan to resolve the all this problems (render data, filter, pagination, sort, ...) on the server side to support lazy loding I advice you to take a look to:https://github.com/react-tools/react-table
I hope that this can help you

How to get a store and column of a grid from xml

I declare one grid in extjs 3.4. I am using ajax call and on success function I am getting column and data. How will I use this data as a store in grid.
Thanks for help.
You can use Ext.data.XmlStore and can refer docs to configure it.
http://docs.sencha.com/extjs/3.4.0/#!/api/Ext.data.XmlStore

DecisionTree Selector in AngularJS

I am trying to find a smart way to create a multi-level decision tree selector in angularjs. So, basically what I am looking for is:
If I select Maingroup "GroupA" from a dropdown list, than I should only see the properties from subgroup1 related to GroupA. The subgroup1 should be also a dropdownlist. Then, refining the selection by another dropdownlist, should display only the possible selections based on Maingroup+Subgroup1.
Finally, the value should be displayed.
[{"Maingroup":"GroupA","Subgroup1":"subgroupA1","Subgroup2":"subgroupA21","Value":11.34},
{"Maingroup":"GroupA","Subgroup1":"subgroupA1","Subgroup2":"subgroupA22","Value":40.7},
{"Maingroup":"GroupA","Subgroup1":"subgroupA2","Subgroup2":"subgroupA23","Value":58.23},
{"Maingroup":"GroupA","Subgroup1":"subgroupA2","Subgroup2":"subgroupA24","Value":20.64},
{"Maingroup":"GroupA","Subgroup1":"subgroupA2","Subgroup2":"subgroupA25","Value":74.77},
I have put a screenshot and the json file on github.
Thanks, any suggestion is welcome.
Take a look at angular-ui-tree connected trees demo. The structure can be reused to achieve your goals.

Resources