I am having the same issue but with a partial view but can't seem to get it to work no matter which way i do it i get undefined is not a function. I am calling the partial view from button click in ajax and passing an id that is used in the query to build the queryable list.
Main view:
@using Infragistics.Web.Mvc
@model NOMISe.eSIMON.Web.UI.Areas.Admin.Models.SystemFeatureViewEditModel
@{
ViewBag.Title = "Index";
}
@(Html.Infragistics().Loader()
.ScriptPath("../Scripts/infragistics/js")
.CssPath("../Content/infragistics/css")
.Render()
)
@(Html.Infragistics().ComboFor(feature => feature.AvailableFeature.FirstOrDefault().Name)
.ID("featureSelect")
.Width("150px")
.DataSource(Model.AvailableFeature.AsQueryable())
.CaseSensitive(false)
.ValueKey("ID")
.TextKey("Name")
.FilteringCondition("contains")
.FilteringType(ComboFilteringType.Local)
.RenderMatchItemsCondition(ComboRenderMatchItemsCondition.Contains)
.DataBind()
.Render()
)
//
$(function () {
$("#getDetails").click(event, function () {
var value = $("#featureSelect").igCombo("value");
$.ajax({
type: 'GET',
url: '@Url.Action("GetFeatureSecurities", "SystemAdmin")',
data: { "id": value },
success: function (data) {
$("#featureSecurityList").html(data);
},
error: function () {
$("#featureSecurityList").html("
There was an error.
");
}
})
})
})
// ]]>
Controller section that if fired
public ActionResult GetFeatureSecurities(string id)
{
ObjectSecurityDTOModel viewModel = new ObjectSecurityDTOModel();
IEnumerable securityList = from o in objectSecurityService.FindByObjectID(new Guid(id))
select new ObjectSecurityDTOModel.ObjectSecurityDTO
{
ID = o.ID,
RoleName = "",//o.Role.Name,
//SecurityMask = o.SecurityMask,
AllowDeny = o.Granted,
CreateBy = "",//o.CreatedBy.DisplayName,
DateCreated = o.DateCreated,
ModifiedBy = "",//o.ModifiedBy.DisplayName,
DateModified = o.DateModified
};
viewModel.ObjectSecurityDTOs = securityList;
return View("_FeatureSecurityList", viewModel.ObjectSecurityDTOs.AsQueryable()); //.ObjectSecurityDTOs.AsQueryable()
}
#endregion
//
// GET: /Admin/SystemAdmin/
public ActionResult Index()
{
SystemFeatureViewEditModel viewModel = new SystemFeatureViewEditModel();
SetupFeatureList(viewModel);
return View(viewModel);
}
Partial view:
@using Infragistics.Web.Mvc;
@model IEnumerable
@(Html.Infragistics().Loader()
.ScriptPath("../Scripts/infragistics/js")
.CssPath("../Content/infragistics/css")
.Render()
)
@(Html.Infragistics()
.Grid(Model.AsQueryable())
.ID("featureSecurities")
.Columns(column =>
{
column.For(x => x.ID).HeaderText("ID").DataType("string").Hidden(true);
column.For(x => x.RoleName).HeaderText("Role Name").DataType("string");
//column.For(x => x.SecurityMask).HeaderText("Security Mask").DataType("int");
column.For(x => x.AllowDeny).HeaderText("Allowed/Denied").DataType("bool");
column.For(x => x.CreateBy).HeaderText("Created By").DataType("string");
column.For(x => x.DateCreated).HeaderText("Date Created").DataType("date");
column.For(x => x.ModifiedBy).HeaderText("Modified By").DataType("string");
column.For(x => x.DateModified).HeaderText("Date Modified").DataType("date");
})
.Features(features =>
{
features.Filtering();
features.Selection().Mode(SelectionMode.Row).MultipleSelection(false).Activation(false);
})
.Width("75%")
.Height("325px")
.PrimaryKey("ID")
.DataSource(Model.AsQueryable())
.DataBind()
.Render()
)
I remebered that i couldn't have datasource set if i passed the data at .Grid(). One error is in my code saying undefiend is not a function and the other is in the infragistics/js/modules/infragistics.ui.grid.framework.js:25.