Hi,
I have a datagrid, used for inline edit. How do I capture the edited row and use that to update in the backend DB? Tried the sample code you provided with 'RemoteAdapter', but it is not working. PLease assist. Also, i need to know how I can add a button outside to add a new for the inline editing grid?
Thank you!
Sunil
|
<ejs-grid id="Grid" allowPaging="true" toolbar="@(new List<string>() {"Add", "Edit", "Update", "Cancel" })">
<e-data-manager json="@ViewBag.DataSource.ToArray()" adaptor="RemoteSaveAdaptor" insertUrl="/Home/Insert" updateUrl="/Home/Update" removeUrl="/Home/Delete"></e-data-manager>
<e-grid-editSettings allowAdding="true" allowDeleting="true" allowEditing="true" mode="Normal" ></e-grid-editSettings>
<e-grid-columns>
<e-grid-column field="OrderID" headerText="Order ID" isPrimaryKey="true" textAlign="Right" width="100"></e-grid-column>
<e-grid-column field="CustomerID" headerText="Customer ID" type="string" validationRules="@(new { required= true })" width="120"></e-grid-column>
<e-grid-column field="Freight" headerText="Freight" textAlign="Right" format="C2" editType="numericedit" width="120"></e-grid-column>
<e-grid-column field="ShipCity" headerText="Ship City" width="150"></e-grid-column>
</e-grid-columns>
</ejs-grid> |
|
document.getElementById("togglebtn1").addEventListener('click', function () {
var grid = document.getElementById('Grid').ej2_instances[0]; // Grid Instances
grid.addRecord(); }); |