Posted 28 August 2020, 6:05 am EST
Manish,
Thanks for the above, but how to I call the update method from the JavaScript after I update the flag?
Here is the FlexGrid definition and the button I am clicking:
button type="button" value="Flag" class="btn btn-outline-dark" onclick="billDelete()">
<img src="~/Images/sheet-remove.png" />
<p>Flag</p>
</button>
@using (Html.BeginForm("Save", "Bill"))
{
@Html.AntiForgeryToken()
@(Html.C1().FlexGrid().Id("policyGrid")
.IsReadOnly(true)
.SortingType(C1.Web.Mvc.Grid.AllowSorting.SingleColumn)
.Bind(ib => ib.Update(Url.Action("GridUpdate")).OnClientQueryComplete("Complete")
.Create(Url.Action("GridCreate"))
.Delete(Url.Action("GridDelete"))
.DisableServerRead(true)
.Bind(Model.Policies))
.AutoGenerateColumns(false)
.IsReadOnly(false)
.ShowColumnFooters()
.CssClass("ListBill")
.Columns(c =>
{
foreach (var col in Model.ColumnList)
{
c.Add(col);
}
})
.AllowAddNew(true)
.AllowDelete(true)
.ShowErrors(true)
.OnClientLoadedRows("fixDefaultJSAlert")
And here is the prototype JavaScript function my button click calls
function billDelete() {
var batchEditGrid = wijmo.Control.getControl('#policyGrid');
var selection = batchEditGrid.selection;
var selectedRow = batchEditGrid.rows[selection.row];
selectedRow.PolicyStatus = "D";
selectedRow.cssClass = "lb-deleted";
batchEditGrid.rows[selection.row] = selectedRow;
}
I looking through the wijmo.flexgrid doc, I don’t see an obvious way to call the update method.
Eric.