react-grid-layout

ReactJS react-grid-layout toggle static property

怎甘沉沦 提交于 2020-12-13 07:54:45
问题 I've been learning React for a couple of days, this time I'm trying to create a grid of draggable widgets, and I found this library on github: react-grid-layout which does that. This time, I'm trying to toggle draggable or static property when clicking on a button but I'm having some troubles doing so. This is my App.js : import React, { Component } from 'react'; import {InputText} from 'primereact/components/inputtext/InputText'; import GridLayout from 'react-grid-layout'; import './App.css'

react-grid-layout example Unknown prop `_grid` on <div> tag

这一生的挚爱 提交于 2019-12-22 10:38:48
问题 I'm trying to implement react-grid-layout . All of the examples pass the grid item configuration through a _grid div property: createElement(el) { ... return ( <div key={i} _grid={el}> ... </div> ); }, In my implementation: return ( <div key={i} _grid={el}> <DashboardTestWidget widgetName={el.name} menuName={this.props.menuName}/> <span className="remove" style={removeStyle} onClick={this.onRemoveItem.bind(this, i)}>x</span> </div> ) I get an error: dashboard_view.browserify.browserified.js

ReactJS: TypeError: this.state.data.map is not a function

邮差的信 提交于 2019-12-11 05:59:33
问题 -Can someone please help me with this. I am getting an error described in the title of this question. I want to put JSON data inside react-grid-layout component. This library can be found on (https://github.com/STRML/react-grid-layout) import React, {Component} from 'react'; import ReactDOM from 'react-dom'; import Employee from './Employee'; import "./react-grid-layout/css/styles.css"; import "./react-resizable/css/styles.css" var ReactGridLayout = require('react-grid-layout'); var data = []

React Pass function to child component

非 Y 不嫁゛ 提交于 2019-12-06 05:10:51
问题 I want to pass a function to a child component but I'm getting this error. Invalid value for prop passedFunction on <div> tag. class Parent extends Component { passedFunction(){} render() { <Child passedFunction={this.passedFunction}/> } } class Child extends Component { render() { <div onClick={this.props.passedFunction}></div> } } Basically what I'm trying to do. var ReactGridLayout = require('react-grid-layout'); var MyFirstGrid = React.createClass({ passedFunction:function(){} render:

react-grid-layout example Unknown prop `_grid` on <div> tag

浪子不回头ぞ 提交于 2019-12-06 04:23:05
I'm trying to implement react-grid-layout . All of the examples pass the grid item configuration through a _grid div property: createElement(el) { ... return ( <div key={i} _grid={el}> ... </div> ); }, In my implementation: return ( <div key={i} _grid={el}> <DashboardTestWidget widgetName={el.name} menuName={this.props.menuName}/> <span className="remove" style={removeStyle} onClick={this.onRemoveItem.bind(this, i)}>x</span> </div> ) I get an error: dashboard_view.browserify.browserified.js:1216 Warning: Unknown prop `_grid` on <div> tag. Remove this prop from the element. For details, see

React Pass function to child component

∥☆過路亽.° 提交于 2019-12-04 10:22:09
I want to pass a function to a child component but I'm getting this error. Invalid value for prop passedFunction on <div> tag. class Parent extends Component { passedFunction(){} render() { <Child passedFunction={this.passedFunction}/> } } class Child extends Component { render() { <div onClick={this.props.passedFunction}></div> } } Basically what I'm trying to do. var ReactGridLayout = require('react-grid-layout'); var MyFirstGrid = React.createClass({ passedFunction:function(){} render: function () { return ( <ReactGridLayout className="layout" cols={12} rowHeight={30} width={1200}> <div key