score:0
Accepted answer
solved!
ok, here is my implementation:
const valuecopy = (column, data) => {
console.log("copied value:",data.rowdata[column]);
return data.rowdata[column];
}
const valuepaste = (column, data) => {
console.log("pasted value:",column, data);
data.rowdata[column] = data.value;
return data.rowdata;
}
const columns = [
textcolumn({ title: 'album id', key: 'albumid', copyvalue: (data)=>valuecopy("albumid", data), pastevalue: (data)=>valuepaste("albumid", data)}),
textcolumn({ title: 'id', key: 'id', copyvalue: (data)=>valuecopy("id", data), pastevalue: (data)=>valuepaste("id", data)}),
textcolumn({ title: 'title', key: 'title', copyvalue: (data)=>valuecopy("title", data), pastevalue: (data)=>valuepaste("title", data) }),
textcolumn({ title: 'url', key: 'url', copyvalue: (data)=>valuecopy("url", data), pastevalue: (data)=>valuepaste("url", data) }),
textcolumn({ title: 'thumbnail url', key: 'thumbnailurl', copyvalue: (data)=>valuecopy("thumbnailurl", data), pastevalue: (data)=>valuepaste("thumbnailurl", data) })
];
and here is my log after copy/paste:
index.js:13 copied value: officia delectus consequatur vero aut veniam explicabo molestias
index.js:13 copied value: aut porro officiis laborum odit ea laudantium corporis
index.js:13 copied value: qui eius qui autem sed
index.js:18 pasted value: url {rowdata: {…}, value: "officia delectus consequatur vero aut veniam explicabo molestias"}
index.js:18 pasted value: url {rowdata: {…}, value: "aut porro officiis laborum odit ea laudantium corporis"}
index.js:18 pasted value: url {rowdata: {…}, value: "qui eius qui autem sed"}
Source: stackoverflow.com
Related Query
- React Datasheet Grid - Logging Copy/Paste Values
- React Data Grid - Adding custom copy paste functionality with multiple tables
- Logging values in React
- Copy and Paste rich text to mailto body in react from clipboard
- AG Grid table data copy to clipboard not working in react
- Not working handleChange when copy & paste in React
- React Datasheet Grid - Render function does not allow to change
- Iterating Values in Grid and Card in React
- How I can disable copy paste in an input box in react js
- Context aware copy and paste in react app
- React Router gives 404 if I try to copy and paste url in new tab
- In React JS : How to copy the all text from grid using "Copy All" icon from MUI
- React Modifying Textarea Values
- How to pass state values to initial values in formik in react js
- How to validate TextInput values in react native?
- useState to update multiple values in React
- DefaultValues of react-hook-form is not setting the values to the Input fields in React JS
- how to make material data grid width to fill the parent component in react js
- How to get values from child components in React
- how to create React search filter for search multiple object key values
- Access Formik's values outside of component | React
- Solve having more than one copy of React in the same app
- Clear form input field values after submitting in react js with ant-design
- Passing react text field input values as parameters to a method
- How to paste clipboard data using React Testing Library?
- React native flexbox - how to do percentages || columns || responsive || grid etc
- How do you update Formik initial values with the react context api values after an AJAX request?
- How to clear input values of dynamic form in react
- How to use React Hooks Context with multiple values for Providers
- Paste from clipboard not working with React Native on iOS simulator
More Query from same tag
- How to apply new css on text change
- how to return cached values from asynchronous function called with then()
- redux-offline app flickers the InitialState values on first load
- Invariant Violation: Dispatch.dispatch(...): Cannot dispatch in the middle of a dispatch
- Props object what is the meaning of passing children to the component from React official documentation
- Material UI Tab - React - change active tab onclick
- Redux-saga: dispatch does not trigger saga sometimes
- TypeError: Cannot read property 'question_set' of undefined
- Next.js (React) + Phaser: ReferenceError: navigator is not defined
- Unterminated string literal.ts(1002)
- Do Lifecycle method's trigger again on setState?
- How to pass state to another component using useHistory?
- Autoclose='outside' doesn't work with multiple menu in react-bootstrap
- what is the difference between const [a, b, c] = array; and const {a, b, c} = array;
- I want to use bootstrap class and next.js modules together inline
- react .map not allowing me to iterate over object
- List Won't Sort By Date
- Match who objects ObjectId to use their "matching" data
- React leaflet showing createRef unexpected token error in example
- Changing table structure causes React to lose track of the DOM
- Getting a 403 error while using Axios in React
- <React/RCTDefines.h> file not found
- How I can push my state elements to the state array?
- amcharts Export with Meteor + React (JSX)
- Passing ref as props to get offsetTop
- How to send unique value to function from onClick in a mapping loop
- react-bootstrap + purgeCss + next.js
- How to get react test using moxios to update the DOM before running later part of the test
- React TypeError: this.state.List.map is not a function
- Using nested objects in React state