Comments (5)
Can you put up a minimal example so I can take a look?
from react-dnd.
I'm writing in coffee. This is ok? Or it is better make some online example?
Object.assign = Object.assign || require('object.assign')
FixedDataTable = require('fixed-data-table')
require('fixed-data-table/dist/fixed-data-table.css')
Table = FixedDataTable.Table
Column = FixedDataTable.Column
DragDropMixin = require('react-dnd').DragDropMixin
rows = [[1,2], [2,2], [2,2], [2,2], [2,2]]
rowGetter = (rowIndex) ->
rows[rowIndex]
Row = React.createClass
mixins: [DragDropMixin]
configureDragDrop: (registerType) ->
registerType('row', {
dragSource: {
beginDrag: ->
{
item: {
id: this.props.id
}
}
}
dropTarget:
over: (item) ->
this.props.moveCard(item.id, this.props.id)
})
render: ->
getDragState = @getDragState('row')
isDragging = @getDragState.isDragging
<div className='red' {...this.dragSourceFor('row')} {...this.dropTargetFor('row')}>
hello
</div>
module.exports = React.createClass
displayName: 'Table'
cellRender: (any_cellData, string_cellDataKey, object_rowData, number_rowIndex, any_columnData, number_width) ->
<Row />
render: ->
<div>
<Table rowHeight={40} rowGetter={rowGetter} rowsCount={rows.length} width={200} height={210} headerHeight={40} >
<Column cellRenderer={@cellRender} label="lol" width={200} dataKey={0} />
</Table>
</div>
from react-dnd.
It would help to see this as a JSBin example (or a separate repo if you wish).
from react-dnd.
Actually, when I was trying to build jsbin example it works, then i check my dev and it works too, so strange. I will make jsbin if this problem arise again. Thanks.
from react-dnd.
No problem!
from react-dnd.
Related Issues (20)
- Preview Image only works once, on the first drag. HOT 3
- Uncaught Invariant Violation: Expected an existing source.
- Library breaks textareas, inputs etc. HOT 1
- table 拖拽时 使用最新版本的React-dnd Api时 出现node.addEventListener is not a function
- 拖动时useDrag无法访问组件内的变量 HOT 1
- @react-dnd/asap trigger swc error `env` and `jsc.target` cannot be used together
- Custom Drag Layer elements don't update until AFTER I drag it. HOT 1
- Redux v5
- Where is dropEffect coming from?
- Hello! I am kupraa from Indonesia, I am very excited to join the project and the communitystar_struck. Wish the project success and strong developmentheart
- [Question] Working with DnD and PrimeReact's DataTable HOT 1
- Will there be a new version released ? and when will the next version be released? HOT 1
- Missing license for some inner packages
- Unable to drag list item after removing/unchecking particular items. Need help.
- Cannot write a unit test to make sure that it is not possible to drag some draggable HOT 1
- Adding accessibility features to the library
- Jest encountered an unexpected token HOT 2
- Styling not working in the beginning of the tutorial chessboard.
- run demo online throw error
- Drop dragged item if it intersects more than 50% of the drop area HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-dnd.