如何为symfony2的stwe/ datatable bundle添加复选框


How to add checkbox to stwe/DatatablesBundle for symfony2

我的symfony2应用程序使用https://github.com/stwe/DatatablesBundle。它仍然有bug,但工作得很好。现在我想在表中有id, id的名称。我想添加一个复选框,这样我就可以通过他们的id来选择他们。我已经找够了,但找不到任何解决办法。谁能帮助我,我如何添加复选框的列id为选择?

一件事:我的'serverSide': false。

 $this->columnBuilder
        ->add("id", "column", array("title" => "Id","type" => "checkbox",))
        ->add("name", "column", array("title" => "Name",))

这是生成列的代码

好的,我找到了解决方案,我不确定这是否是解决问题的最佳方法,但我仍然可以锻炼我的问题。

->add(null, "multiselect", array(
            "attributes" => array(
                "name" => "check",                ),
            "actions" => array(
                array(
                    "route" => "artist_show",
                    "route_parameters" => array(
                        "id" => "id"
                    ),
                    "label" => "Select",
                    )
        )))

添加多重选择选项解决了复选框的必要性