I am able to get data from the source.Read method as pictured. However, the control doesn't display back the data.
Once I get that working, I need to post changes to the item order. If I have:
- a
- b
- c
Then I move c up one:
- a
- c
- b
How do I capture the position of c and the position of b to update the database using the Order property? I assume I capture the onReorder event.
public partial class Option
{
public int Id { get; set; }
[MaxLength(50)]
public string Name { get; set; }
[MaxLength(128)]
public string Description { get; set; }
public int Order { get; set; }
...
@(Html.Kendo().ListBox()
.DataTextField("Name")
.DataValueField("Id")
.DataSource(source =>
{
source.Read(read =>
{
read.Action("IndexJson", "SessionOptionTemplates").Data("gridGetData");
});
})
.Toolbar(toolbar =>
{
toolbar.Position(ListBoxToolbarPosition.Right);
toolbar.Tools(tools => tools
.MoveUp()
.MoveDown()
.Remove());
})
.Events(events => events
.Remove("onRemove")
.Reorder("onReorder")
))
Thanks in advance for your help, Joel