Hi Manfred,
You can control the button visibility on the databound event (client side).
The buttons are actually links so I'd rather advice you to control the
visibility instead of the enable/disable state.
Here is an example:
MyDataTable.java
@Override
public void renderHead(IHeaderResponse response)
{
super.renderHead(response);
response.render(new
JavaScriptPackageHeaderItem(MyDataTable.class));
// MyDataTable.js (dataBound)
}
// events //
@Override
public void onConfigure(JQueryBehavior behavior)
{
super.onConfigure(behavior);
behavior.setOption("dataBound", "MyDataTable_dataBound"); // or
MyDataTable.dataBound, depending of your js coding style
}
MyDataTable.js
function MyDataTable_dataBound(e) {
datatable_dataBound(e); // calls wicket-kendo-ui default
var $grid = e.sender; // or 'this'
// remove delete button
$grid.tbody.find("tr .k-grid-delete").each(function () {
var row = $(this).closest("tr")
var dataItem = $grid.dataItem(row);
// check if 'myprop' is set
if (dataItem.myprop) {
$(this).remove(); // or $(this).hide(), both work AFAIK
}
});
}
Hope this helps,
Sebastien.
On Tue, Oct 3, 2017 at 10:44 PM, Manfred Bergmann <[email protected]>
wrote:
> Hi.
>
> Is it possible, or do you have some pointers if it is possible to render
> row
> content different on the Wicket Kendo Datatable component?
> For example, say there is a column with command buttons. I'd like to
> disable/enable those on a per row basis depending on the row model.
>
>
> Regards,
> Manfred
>
>
> --
> Sent from: http://apache-wicket.1842946.n4.nabble.com/Users-forum-
> f1842947.html
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>