我试图在具有恒定标题的表中具有可扩展列表项。对于这个我使用Table并ExpansionPanel从成分反应的材料UI 1.0.0-beta.34。但是,桌子不是很好。所有的正文数据都放在一个标题下TableCell。这是我的代码。
表组件:
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { withStyles } from 'material-ui/styles';
import Table, { TableBody, TableCell, TableHead, TableRow } from 'material-ui/Table';
import Paper from 'material-ui/Paper';
import { styles } from './styles';
import ExpandableTableRow from 'client/components/expandable-table-row';
class GenericTable extends Component {
render() {
const { classes, items, headItems } = this.props;
return (
<Paper className={classes.paper}>
<Table>
<TableHead>
<TableRow>
{headItems.map((n, i) => {
return <TableCell className={classes.column} key={i}>{n}</TableCell> …Run Code Online (Sandbox Code Playgroud) 我正在学习如何在Play Framework中使用Ebean ORM,但却遇到了错误.我有很多课程,但问题出在这两个课程中.
StockItem类:
import com.avaje.ebean.Model;
import com.google.inject.Inject;
import javax.persistence.*;
@Entity
public class StockItem extends Model{
@Id
private Long id;
/*
@ManyToOne
private Warehouse warehouse;
*/
@ManyToOne
private Product product;
private Long quantity;
public static Finder<Long,StockItem> find = new Finder<>(StockItem.class);
public StockItem(){
//left blank
}
public String toString() {
return String.format("%d %s",quantity,product);
}
///gettters and setters
}
Run Code Online (Sandbox Code Playgroud)
仓库类:
import com.avaje.ebean.Model;
import javax.persistence.Entity;
@Entity
public class Warehouse extends Model{
private String name;
/*
@OneToMany(mappedBy="warehouse")
private List<StockItem> stock; // = new ArrayList<>(); …Run Code Online (Sandbox Code Playgroud)