Closed mdbergmann closed 3 years ago
Hi,
I wired the change
js-event to DataTable#onChange
event which respond when the user selects a row. The event is automatically enabled if you provide the selectable
option:
options.set("selectable", true);
options.set("selectable", Options.asString("row"));
options.set("selectable", Options.asString("multiple, row"));
caution does not work for cell
The onChange
usage is like this for instance:
final DataTable<Product> table = new DataTable<Product>("datatable", newColumnList(), newDataProvider(), 25, options) {
@Override
public void onChange(AjaxRequestTarget target, JSONArray items)
{
final List<Integer> ids = JsonUtils.toJSONList(items).stream().map(o -> o.getInt("id")).collect(Collectors.toList());
final String message = String.format("Selected: %s", ids);
feedback.info(message);
feedback.refresh(target);
}
};
Many thanks.
Hi.
Please see the Wicket mailing list. http://apache-wicket.1842946.n4.nabble.com/Kendo-DataTable-row-click-handler-td4684468.html
We're using Wicket 8.9.0. Looking at the DataTable class, how would the click event being transported to the Java part? I think that's missing or? Can you check?