MultiLookup control demo
MultiLookup needs a controller or urls to be specified, by default convention it
will look for a controller with the same name as it + "MultiLookupController"
-
action GetItems
- used to show the value in the readonly field, it will receive av
parameter which is going to be the keys of the selected items -
action Search
- gets data for the search result in it's popup, it receives aselected
parameter that represents the selected values, it should return aJson(AjaxListResult)
, so it has same features as the AjaxList (table layout, custom item template) action Selected
- gets data for the selected items in the popup
MultiLookup Grid
MultiLookup with grids inside the popup, done using the MultiLookupGrid mod that also uses PopupUrl extension.
MultiLookup with Custom Items
-
Mango
-
Apple
-
Papaya
MultiLookupDemo/Index.cshtml
@(Html.Awe().MultiLookup(new MultiLookupOpt {
Name = "MealsCustomItem",
Controller = "MealsCustomItemMultiLookup",
Value = Db.Meals.Take(3).Select(o => o.Id).ToArray(),
Dropdown = false,
Modal = true,
CustomSearch = true,
Height = 700,
MaxWidth = 1000,
CssClass = "MLLimH" // limit caption height
}))
Comments