这是我的问题:我需要使用材质 UI 在 React 上创建多个选择(带有复选框),如下图所示:
我的数据位于如下所示的数组中
data = [
{
id: 199,
name: "Argentina",
state: [
{ name: "Buenos Aires", id: 1 },
{ name: "Cordoba", id: 2 },
{ name: "Chaco", id: 2 }
]
},
{
id: 200,
name: "USA",
state: [
{ name: "California", id: 4 },
{ name: "Florida", id: 5 },
{ name: "Texas", id: 6 }
]
}
]
Run Code Online (Sandbox Code Playgroud)
完美的。一切似乎都必须做2个嵌套地图,没有什么特别的。同时,我尝试这样做:
<InputLabel htmlFor="grouped-select">Grouping</InputLabel>
<Select
defaultValue={[]}
id="grouped-select"
onChange={handleChange}
multiple
>
<MenuItem value="">
<Checkbox />
<em>All</em>
</MenuItem> …Run Code Online (Sandbox Code Playgroud) 我正在试验akka,并且(在文档之后),我有以下代码:
Source<String, NotUsed> words =
Source.from(Arrays.asList("hello", "hi"));
Timeout askTimeout = Timeout.apply(5, TimeUnit.SECONDS);
words
.mapAsync(5, elem -> ask(ref, elem, askTimeout))
.map(elem -> (String) elem)
// continue processing of the replies from the actor
.map(elem -> elem.toLowerCase())
.runWith(Sink.ignore(), materializer);
Run Code Online (Sandbox Code Playgroud)
但是我找不到"import static"指令来使"ask方法"起作用.我有:
无法解决方法问
我做错了什么?我正在使用akka v 2.4(使用Java,没有Scala)并按照以下步骤逐步完成文档:http: //doc.akka.io/docs/akka/2.4/java/stream/stream-integrations.html
谢谢.
我的问题是,当我尝试使用$em->find方法查找数据库记录时,它返回一个Controller.
让我举一个例子:
Neostat\DiagnosticoBundle\Controller\ComponentController.php:
$em = $this->getDoctrine()->getEntityManager();
$diagnostico = $em->getRepository('NeostatDiagnosticoBundle:Diagnostico')->find($id);
var_dump(get_class($diagnostico));
Run Code Online (Sandbox Code Playgroud)
它回来了Neostat\DiagnosticoBundle\Controller\ComponentController.
但我有一个名为实体Diagnostico.php在src/Neostat/DiagnosticoBundle/Entity/Diagnostico.php:
namespace Neostat\DiagnosticoBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
use Neostat\PacienteBundle\Entity\Paciente;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
/**
* Diagnostico
*
* @ORM\Table(name="diagnostico")
* @ORM\Entity(repositoryClass="Neostat\DiagnosticoBundle\Entity\DiagnosticoRepository")
* @UniqueEntity(fields={"nombre"}, message="Ya existe un diagnostico con ese nombre.")
*/
class Diagnostico
{
/**
* @var integer
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
// etc...
}
Run Code Online (Sandbox Code Playgroud)
我究竟做错了什么?
akka ×1
akka-stream ×1
doctrine ×1
java ×1
javascript ×1
material-ui ×1
php ×1
reactjs ×1
symfony ×1