Works perfectly but now that I migrated to ASP.Net Core and 17.1.0.38, I have not been able to do migrate the same grid.
Please I need a working Project example of any grid wih the same functionality as my 16.2.0.48 version, but in ASP.NET Core (Essential JS1) 17.1.0.38.
Attached are the original portions in version in 16.2.0.48 and the incomplete 17.1.0.38 version in ASP.Net Core.
#2:
In grid version 16.2.0.48 editmode "Dialog" I can customize the dialog's title, but not in 17.1.0.38. In 17.1.0.38 I can change the language, i.e.: "Editing Record 1" -> "Editar Registro #1", but I need it without the record's Id, just :Editar Registro". How is it done now? I've tried some examples from forum and help sections but they don't work.
|
<ej-grid id="FlatGrid"
allow-sorting="true"
allow-paging="true"
allow-filtering="true"
allow-searching="true"
locale="es-GT"
is-responsive="true"
enable-responsive-row="true"
action-complete="complete"
action-failure="OnGridActionFailure"
allow-resize-to-fit="true"
allow-scrolling="true"
load="onGridLoad">
<e-scroll-settings width=@("100%")
height=@("100%")>
</e-scroll-settings>
<e-filter-settings filter-type="Excel"
max-filter-choices="100"
enable-case-sensitivity="false">
</e-filter-settings>
<e-datamanager json="ViewBag.dataSource" insert-url="UrlInsert" update-url="UrlUpdate" remove-url="UrlDelete" adaptor="remoteSaveAdaptor"></e-datamanager>
<e-edit-settings allow-adding="true"
allow-editing="true"
allow-deleting="true" edit-mode="DialogTemplate" dialog-editor-template-id="#template">
</e-edit-settings>
<e-toolbar-settings show-toolbar="true"
toolbar-items='@new List<string> {"add","edit","delete","update","cancel","search"}'>
</e-toolbar-settings>
<e-context-menu-settings enable-context-menu="true">
</e-context-menu-settings>
<e-columns>
<e-column field="OrderID" header-text="Order ID" is-primary-key="true" text-align="Right" validation-rules='new Dictionary<string, object>() { {"required",true}, {"number",true} }' width="75"></e-column>
<e-column field="CustomerID" header-text="Customer ID" validation-rules='new Dictionary<string, object>() { {"required",true}, {"minlength",3} }' width="80"></e-column>
<e-column field="EmployeeID" foreign-key-field="EmployeeID" foreign-key-value="FirstName" header-text="Employee ID" datasource="ViewBag.columnData" text-align="Right" edit-type="@(EditingType.DropdownEdit)" width="75"></e-column>
<e-column field="Freight" header-text="Freight" format="{0:C}" numeric-edit-options="@new EditorProperties(){ DecimalPlaces = 2}" validation-rules='new Dictionary<string, object>() { {"required",true}, {"range","[0,1000]"} }' edit-type="@(EditingType.NumericEdit)" text-align=Right width="75"></e-column>
<e-column field="ShipCity" header-text="Ship City" width="110" text-align="Left"></e-column>
</e-columns>
</ej-grid>
<script type="text/javascript">
function complete(args) {
if (args.requestType == "beginedit" || args.requestType == "add")
$("#" + this._id + "_dialogEdit").ejDialog({ title: "Customize Edit form title" }); // to customize the edit dialog title
if ((args.requestType == "beginedit" || args.requestType == "add") && args.model.editSettings.editMode == "dialogtemplate") {
if (args.requestType == "beginedit") $("#OrderID").attr("disabled", "disabled");
$("#Freight").ejNumericTextbox({ value: parseFloat($("#Freight").val()), width: "116px", height: "34px", decimalPlaces: 2 });
$("#OrderDate").ejDatePicker();
// define dataSource for dropdownlist while editing a foreignkey
$("#EmployeeID").ejDropDownList({
width: '116px', dataSource: ej.DataManager({
url: "/api/Orders",
adaptor: new ej.WebApiAdaptor()
}), fields: { text: "FirstName", value: "EmployeeID" }
});
}
}
</script>
//////////////////////////////////
public ActionResult Index()
{
if (orddata.Count() == 0)
BindData();
ViewBag.dataSource = orddata;
// dataSource for foreignkeey column
ViewBag.columnData = new DataSource() { URL = "/api/Orders", Adaptor = "WebApiAdaptor" };
return View();
}
|
Hello. Thanks for the quick response but still having problems:
1. The provided project does not work:
IMPORTANT: please take note that property names in the response magically
change to camel-case notation!!! I didn't to this.
I ask myself: Am I missing something or perhaps
it's a Syncfusion/VStutio glitch?
I've had this problem before and fixed it by matching the grid field names
with those names in the response.
4. Examining ViewBag.dataSource in the controller yields:
Here you can see 45 records are returned, but
dataSource seem NOT MATCH those in the Network-Response shown above in
#2. Perhaps an error with serialization or grid configuration. I don't see the names of the Orders Table in the Network-Response, only those of the employees. The grid in the Index View has fields configured for Orders which match those in the ViewBag.dataSource.