@Html.EJ().ListBox("searchList").ListBoxFields(df => df.Text("CompanyName")).AllowDrag(true).AllowDrop(false).Width("100%").Datasource(ds => ds.URL("/api/Orders/5").Adaptor(AdaptorType.WebApiAdaptor).CrossDomain(true)).Query("ej.Query().take(0)"). // initially give take as 0
AllowVirtualScrolling(true).VirtualScrollMode(VirtualScrollMode.Normal)
function getListboxItems() {
var query = new ej.Query().skip(0).take(15); //now give your required items to take in query
obj = $("#searchList").ejListBox("instance");
obj.setModel({ query: query }); //set the query via setmodel to refresh
obj.refresh();
public object Get(int id)
{
var queryString = HttpContext.Current.Request.QueryString; // take the skip and take using the querystring
int skip = Convert.ToInt32(queryString["$skip"]);
int take = Convert.ToInt32(queryString["$top"]);
var result = db.OrdersViews.Skip(skip).Take(take).ToList(); // filter result based on skip and take
return new
{
Items = result,
Count = result.Count()
}; |
Hello Arun,
thanks for the answer. Your workaround works, but only initially added items are draggable (also in your sample solution). Iitems added after virtual scrolling are not. This is very important for my implementation. I can see in developer tools that they're completely missing e-draggable and e-js classes.
Kind regards,
Ivan
Thanks Arun
Is there a workaround until bugfix is released?
Regards,
Ivan
|
@Html.EJ().ListBox("searchList").ListBoxFields(df => df.Text("CompanyName").ID("data")).AllowDrag(true).AllowDrop(false).Width("100%").Datasource(ds => ds.URL("/api/Orders/5").Adaptor(AdaptorType.WebApiAdaptor).CrossDomain(true)).Query("ej.Query().take(0)").AllowVirtualScrolling(true)
.VirtualScrollMode(VirtualScrollMode.Normal).ClientSideEvents(ce=>ce.ActionComplete("oncomplete"))
<script type="text/javascript">
function oncomplete(e) {
this._addDragableClass()._enableDragDrop(); //manually add the drag and drop classes
}
</script>
|