Code Monkey home page Code Monkey logo

ashvin27 / react-datatable Goto Github PK

View Code? Open in Web Editor NEW
80.0 6.0 46.0 7.1 MB

React-datatable is a component which provide ability to create multifunctional table using single component like jQuery Datatable. It's fully customizable and easy to integrate in any react component. Bootstrap compatible.

License: MIT License

JavaScript 95.87% CSS 1.13% HTML 2.99%
datatables datatables-plugin react-table react-datagrid react-data-table react-datatable react data table

react-datatable's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

react-datatable's Issues

print and export issue while searching

if i search some keyword and i got the result the searched, and now i am trying to print or export the data. It should only print or export the searched data not the whole data. please give me the suggestion i want to implement like the way.

Thank you :)

EXPORT THE EXCEL

this is my table 1

I want to remove this column. What should I do?
2

Uncaught Error: Invariant failed: You should not use <Link> outside a <Router>

When I tried to download xls file by clicking export button its gives the error.

Uncaught Error: Invariant failed: You should not use <Link> outside a <Router>
    at invariant (tiny-invariant.esm.js:13)
    at Object.children (react-router-dom.js:147)
    at ReactDOMServerRenderer.render (react-dom-server.browser.development.js:3749)
    at ReactDOMServerRenderer.read (react-dom-server.browser.development.js:3453)
    at Object.renderToStaticMarkup (react-dom-server.browser.development.js:4086)
    at ReactDatatable.getExportHtml (index.js:377)
    at ReactDatatable.exportToExcel (index.js:414)
    at HTMLUnknownElement.callCallback (react-dom.development.js:363)
    at Object.invokeGuardedCallbackDev (react-dom.development.js:412)
    at invokeGuardedCallback (react-dom.development.js:466)
    at invokeGuardedCallbackAndCatchFirstError (react-dom.development.js:481)
    at executeDispatch (react-dom.development.js:614)
    at executeDispatchesInOrder (react-dom.development.js:639)
    at executeDispatchesAndRelease (react-dom.development.js:744)
    at executeDispatchesAndReleaseTopLevel (react-dom.development.js:753)
    at forEachAccumulated (react-dom.development.js:725)
    at runEventsInBatch (react-dom.development.js:770)
    at runExtractedPluginEventsInBatch (react-dom.development.js:916)
    at handleTopLevel (react-dom.development.js:6171)
    at batchedEventUpdates (react-dom.development.js:2422)
    at dispatchEventForPluginEventSystem (react-dom.development.js:6271)
    at dispatchEvent (react-dom.development.js:6301)
    at unstable_runWithPriority (scheduler.development.js:674)
    at runWithPriority$2 (react-dom.development.js:11834)
    at discreteUpdates$1 (react-dom.development.js:22935)
    at discreteUpdates (react-dom.development.js:2440)
    at dispatchDiscreteEvent (react-dom.development.js:6254)
  constructor(props) {
        super(props);

        this.columns = [
            {
                key: "course_name",
                text: "Course  Name", 
                sortable: true,
                width: 180,
                cell: (record, index) => {
                    return (
                        <Link to={{
                            pathname: `/updatecourseadmin`,
                            state: { 
                                course_id:  record.course_id,
                                course_auto_id:  record.id
                             
                            }
                        }} className="enquiryLink">{ record.course_name }</Link>
                    );
                }
            },
            {
                key: "institute_name",
                text: "Institute", 
                sortable: true,
                width: 150
            },
            {
                key: "course_category",
                text: "Category", 
                sortable: true,
                width: 150
            },
            {
                key: "approve",
                text: "Approve", 
                sortable: false,
                width: 130,
                cell: (record, index) => {
                    return (
                        <UnapproveChildApprove feature={record.id}  approved={record.approved}/>
                    );
                }
            }, 
            {
                key: "preview",
                text: "Preview", 
                sortable: false,
                width: 100,
                cell: (record, index) => {
                    return (  
                        <img src={api_server.base_url+"/"+record.image} style={{height:"50px","width":"80px"}} />
                    );
                }
            }
        ];
        this.config = {
            page_size: 10,
            length_menu: [10, 20, 50],
            show_filter: true,
            show_pagination: true,
            pagination: 'advance',
            filename: "approved_courses",
            button: {
                excel: true,
                print: true,
                csv: true
            }
        } 

Please help

Pagination for empty records

When there is an empty record, the pagination still enables next and last buttons. This shouldn't be so. All pagination buttons should be disabled for empty records.

Rendering nested column data

When I am trying to render nested data, How should I need to provide "KEY" name ?

Example : If I have below data, How can I print name in single column ?

let data = [
{
id: 1,
userDetails : {
name : "vinod",
age : 23
}
}

{
id: 1,
userDetails : {
name : "kumar",
age : 22
}
}

]

Nested

Hi can't read some nested data from my json file. please help

Is this dead?

Is this project dead and if so, where is an updated datagrid for React? I started learning react and started using this last month, and running into some issues.

  • images not appearing on the export buttons
  • how to add a checkbox and or radio button in a cell
  • cell formatting based on data

If there is an updated version of this datagrid or if it's ghost now, can someone point me to a newer datagrid to use within React?

Nested json Data

Hey Ashvin27, am trying to read a nested json data, but can't seem to. please i do require your assistance.. Please do share any thoughts on this

0 Int not renders

I find out that if we have 0 in one of column results then that 0 is not renders
Screenshot from 2021-02-08 20-27-30
Screenshot from 2021-02-09 00-40-32

Is that ok? or needs a fix?

React Javascript Warning

Hello,
Some functions gives an warning because of React's Warning: A future version of React will block javascript: URLs as a security precaution. Use event handlers instead if you can. If you need to generate unsafe HTML try using dangerouslySetInnerHTML instead. React was passed "javascript:void(0);

Thanks for great job.

csv

i can't the csv export functionality isn't working well is there a way to fix it

Bug on CSS

`./node_modules/@ashvin27/react-datatable/lib/style.css 1:12
Module parse failed: Unexpected token (1:12)
You may need an appropriate loader to handle this file type.

th.sortable {
| color: #2196F3;
| cursor: pointer;`

Dealing The Big Data or paginate call

when we need to deal any big data, we call api for paginate.
like apicall?start_at=20&limitation=10

To use this plugin, I should load the whole data and load them at a once.
it make me to feel the website so slow.
Is there any way to call api for paginate?

React CSV download from Cell tag

Hi i am trying to export my table in CSV but whenever i try to export it only show the data not in cell tag so i wanna know is there is any way of doing it please help me
Thank You.

            {
                // key: "id",
                text: "S.No.",
                className: "id",
                align: "left",
                sortable: true,
                cell:(row, index)=>index+1
            },
            {
                key: "tx_id",
                text: "Transaction_id",
                className: "transaction_id",
                align: "left",
                sortable: true,
            },
            {
                key: "email",
                text: "Email",
                className: "email",
                align: "left",
                sortable: true,
            },
            

            {
                key: "amount",
                text: "Amount",
                className: "amount",
                align: "left",
                sortable: true,
                cell: record => {
                    return (
                        <span>
                            {Math.abs(record.coin_amount)}
                        </span>
                    );
                }
            },
            {
                key: "coinName",
                text: "	Cryptocoin",
                className: "coinName",
                align: "left",
                sortable: true,
                cell: record => {
                    return (
                        <span>
                        {record.coinName == undefined ?
                            (this.state.cryptoName):(record.coinName)
                        }
                        </span>
                    );
                }
            },
            // {
            //     key: "status",
            //     text: "Status",
            //     className: "status",
            //     align: "left",
            //     sortable: true
            // },
            {
                key: "created",
                text: "Date",
                className: "date",
                align: "left",
                sortable: true,
                cell: record => {
                    return (
                        <Fragment>
                            {Moment(record.created).format('lll')}
                        </Fragment>
                    );
                }
            },
]````

No example for Server-side pagination

Hi,
The library is nice. Easy to integrate. But could not find the server-side example of the implementation.
Please add it in the documentation.

Each child in a list should have a unique "key" prop

Check the render method of ReactDatatable. See https://fb.me/react-warning-keys for more information.

in tr (created by ReactDatatable)
in ReactDatatable (at Users.js:140)
in div (at Users.js:137)
in div (at Users.js:136)
in div (at Users.js:134)
in div (at Users.js:132)
in Users (created by ConnectFunction)
in ConnectFunction (at PrivateRoute.js:11)
in Route (at PrivateRoute.js:7)
in PrivateRoute (created by ConnectFunction)
in ConnectFunction (at App.js:46)
in Switch (at App.js:44)
in Switch (at App.js:40)
in div (at App.js:39)
in Router (created by BrowserRouter)
in BrowserRouter (at App.js:38)
in Provider (at App.js:37)
in App (at src/index.js:7)

Because of this error search, pagination, sorting not working Kindly help me out

CSV doesn't contain computed values

Hi Ashvin, great work here

Issue
CSV does not contain computed data

cell: record => ${record.lastName} ${record.firstName}

other values show up, but values that were computed via cell do not show up in csv or pdf, they do show up in the table though

Support for Functional Components

Hi, thanks for the nice package.
Can this package be used with functional components? because I could not see an example in your docs. If it supports functional components, please update the docs

Custom Header and Footer

I would love to be able to add a footer so I can calculate totals without that item sorting.

It would also be great to be able to do a custom component/custom title for pdf print

Problem on changing the results per page when the user is in another pagination,

Hi There!

Thank you for doing this awesome project, I wanted to tell that I found a little issue when a user changes to watch all results in the list of the component only if the user is in another page, for example.

To reproduce:
Go to page 2 or 3 etc... and then select ALL results...
No results are found in the component...

if you please check it out. I'll be great
Thank you again and have a nice day

Failed to Compile

./node_modules/@ashvin27/react-datatable/lib/up-arrow.png 1:0
Module parse failed: Unexpected character '�' (1:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
(Source code omitted for this binary file)

Eliminate y update row ?

Hi Ashvin, I'm trying to delete a row so that it disappears from the list without reloading but I don't know how to do it, I don't think it has it, but I wanted to ask you first to see if it is possible or should I try to modify the package.

image

image

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.