You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Manfred Bergmann <mb...@software-by-mabe.com> on 2017/02/17 17:41:07 UTC
Kendo UI - DataTable selection
Hi.
Some questions regarding the Kendo UI DataTable.
Is there a callback when a row has been clicked/selected?
I've seen that there is not directly a selection callback.
But a row can be selected and then a toolbar button "View" clicked.
Now, I have tried that with:
Toolbar button as:
new ToolbarButton("view", Model.of("View"), "data.id"),
and for options I have added:
options.set("selectable", true)
where "data.id" is a valid property to the data of the row.
But the onClick event of the toolbar button doesn't transport the clicked
row.
The values parameter is empty.
Am I missing something?
Regards,
Manfred
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Kendo-UI-DataTable-selection-tp4677141.html
Sent from the Users forum mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Kendo UI - DataTable selection
Posted by Sebastien <se...@gmail.com>.
Hi Manfred,
PropertyColumn generates the underlying json using
PropertyResolver.getValue, that's why it works.
ToolbarButton and CommandButton should read directly from the json, and I
didn't thought about sub-expressions.
Please open an issue (and specify the version you are using). The fix is
straightforward, you will be get a snapshot shortly.
Thanks & best regards,
Sebastien
On Sun, Feb 19, 2017 at 8:53 PM, Manfred Bergmann <mb...@software-by-mabe.com>
wrote:
> Hi Sebastien.
>
>
> Sebastien wrote
> >> where "data.id" is a valid property to the data of the row.
> > Actually, I think "id" is more valid.
>
> The path to by model data id is in second level.
> That's why "data.id". For the PropertyColumn/IdPropertyColumn that worked
> fine.
> Couldn't understand thus why the CommandButton wasn't able to pull that
> data.
> But you explanation makes sense.
>
>
> Sebastien wrote
> > So, in short: use "id" and an IdPropertyColumn.
>
> Yep, doing that, thanks.
>
>
> Manfred
>
> --
> View this message in context: http://apache-wicket.1842946.
> n4.nabble.com/Kendo-UI-DataTable-selection-tp4677141p4677152.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
Re: Kendo UI - DataTable selection
Posted by Manfred Bergmann <mb...@software-by-mabe.com>.
Hi Sebastien.
Sebastien wrote
>> where "data.id" is a valid property to the data of the row.
> Actually, I think "id" is more valid.
The path to by model data id is in second level.
That's why "data.id". For the PropertyColumn/IdPropertyColumn that worked
fine.
Couldn't understand thus why the CommandButton wasn't able to pull that
data.
But you explanation makes sense.
Sebastien wrote
> So, in short: use "id" and an IdPropertyColumn.
Yep, doing that, thanks.
Manfred
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Kendo-UI-DataTable-selection-tp4677141p4677152.html
Sent from the Users forum mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Kendo UI - DataTable selection
Posted by Sebastien <se...@gmail.com>.
Hi Manfred,
> where "data.id" is a valid property to the data of the row.
Actually, I think "id" is more valid.
CommandButton and ToolbarButton are designed to return the row property
value(s), if supplied. If not supplied, the default property for
CommandButton is "id", and the default for ToolbarButton is null (because a
toolbar button is not necessary functionally linked to selectable rows).
Please also note that it is a good practice to use an IdPropertyColumn
(like in the samples), because it automatically sets the kendo grid model
id (used for default CRUD operations).
So, in short: use "id" and an IdPropertyColumn.
Hope this helps,
Sebastien.
On Sun, Feb 19, 2017 at 12:43 PM, Martin Grigorov <martin.grigorov@gmail.com
> wrote:
> On Feb 19, 2017 10:35 AM, "Manfred Bergmann" <mb...@software-by-mabe.com>
> wrote:
>
> Solved. Problem was access to the model data
>
>
> Without more details it is hard to say what is inconsistent and how it
> could be improved!
>
>
> Interestingly though that the PropertyColumn could access the data but the
> CommandButton not.
> Not sure about the internals but that's not a consistent behavior.
>
>
> Manfred
>
> --
> View this message in context: http://apache-wicket.1842946.
> n4.nabble.com/Kendo-UI-DataTable-selection-tp4677141p4677148.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
Re: Kendo UI - DataTable selection
Posted by Martin Grigorov <ma...@gmail.com>.
On Feb 19, 2017 10:35 AM, "Manfred Bergmann" <mb...@software-by-mabe.com>
wrote:
Solved. Problem was access to the model data
Without more details it is hard to say what is inconsistent and how it
could be improved!
Interestingly though that the PropertyColumn could access the data but the
CommandButton not.
Not sure about the internals but that's not a consistent behavior.
Manfred
--
View this message in context: http://apache-wicket.1842946.
n4.nabble.com/Kendo-UI-DataTable-selection-tp4677141p4677148.html
Sent from the Users forum mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Kendo UI - DataTable selection
Posted by Manfred Bergmann <mb...@software-by-mabe.com>.
Solved. Problem was access to the model data.
Interestingly though that the PropertyColumn could access the data but the
CommandButton not.
Not sure about the internals but that's not a consistent behavior.
Manfred
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Kendo-UI-DataTable-selection-tp4677141p4677148.html
Sent from the Users forum mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org