@Scripts.Render("https://cdn.syncfusion.com/js/assets/external/jsrender.min.js") is in the shared layouts file.
It doesn’t look like there are any templates used.
I’ve added the cshtml file which holds these grids, as a zip.
I believe I have trial versions on EJ1 and EJ2 on my machine.
Right now I think I should concentrate on the general edit problem (issue 2 above).
I first got the browser error when I only had EJ2 trial, after talking to support I Installed (syncfusionessentialjavascript-js1_trial) but the error is still appearing. Was this the correct thing I’ve loaded, and do I need to do anything else in order to make the app recognize the EJ1 commands?
Should I remove these trial versions and reinstall a version of EJ1? If so how do I do this what should I be loading?
It doesn’t look like the ej.web.all.min.js is not being recognised by the solution in general. As I made a new (standard simple) Controller and View and hooked up the same grid with the same model. This was able to be edited as you would expect when using the view bag, and I was able to wire up save routines to update the database with no issue.
However my initial grids still have the same error. I tried passing the date via view bag rather than the partial view type originally setup.
E.g.
model.DryMethodDeviations = conTxt.MethodDeviations.Where(x => x.JobID == jobID && x.StackID == stackID && x.TestTypeID == testTypeID && x.WetChem == false).ToList();
model.WetMethodDeviations = conTxt.MethodDeviations.Where(x => x.JobID == jobID && x.StackID == stackID && x.TestTypeID == testTypeID && x.WetChem == true).ToList();
ViewBag.datasource = model; //testing
// or
return PartialView(TPMcalclulations(model));
// shows the data, but gives a browser error n.render[(this._id + “JSONEditingTemplate”)] is not a function
But this made no difference, and I’m still getting the same error: see attached screen shot.
So it appears that the issue is with the way the model data is being pulled into the grid.
Could this be because of the partial view?
Or is there something wrong with the permissions of the passed model?
I’ve tried initiating this in the cshtml grid various ways, but it doesn't make any difference.
E.g.
.Datasource(ds => ds.Json((IEnumerable<object>)ViewBag.dataSource.DryMethodDeviations).UpdateURL("NormalUpdate").InsertURL("NormalInsert").RemoveURL("NormalDelete").Adaptor(AdaptorType.RemoteSaveAdaptor)) // Using the ViewBag Should jump to the relevant code – works in my test code but doesn’t allow editing in the main
.Datasource((IEnumerable<BertReport.Models.MethodDeviation>)Model.WetMethodDeviations)
// Simple test using the model – also shows text in grid but dosn’t allow editing. (same browser error for both)
@(Html.EJ().Grid<object>("Grid1").Datasource((IEnumerable<object>)ViewBag.data).AllowPaging()
.ClientSideEvents(eve => eve.ActionComplete("actionComplete"))
.Columns(col =>
{
col.Field("OrderID").HeaderText("Order ID").IsPrimaryKey(true).Add();
col.Field("CustomerID").HeaderText("Customer ID").EditType(EditingType.DropdownEdit).Add();
}))
<script>
function actionComplete(args) {
//while editing the grid
if (args.requestType == "beginedit" || args.requestType == "add") {
var dpDataSource = [{ value: 'One', text: 'One' }, { value: 'two', text: 'two' }, { value: 'three', text: 'three' }, { value: 'four', text: 'four' }, {
value: 'five', text: 'five'}, ];
$("#Grid1CustomerID").ejDropDownList({ dataSource: dpDataSource, selectedIndex: 1}); //Set the new Dropdown datasource
}
}
</script>
|