Hey there,
I am using Jquery 2012 vol 1 and while using igGrid, if I add 2 rows and delete one of them then transactions count submitted to action should be 1 but it is 3 as this is creating 2 transactions for newrow and deleterow.
am i missing something to implement new feature (Grid Net Transactions)?
my view is :
@Using Html.BeginForm("SaveAgreements", "Contact", FormMethod.Post, New With {.id = "AgreementForm"}) @<fieldset> <legend>Contact Agreements</legend> @(Html.Infragistics().Grid(Of Advantage.Web.Objects.ContactAgreementListItem) _ .ID("grid1").PrimaryKey("AgreementId") _ .AutoGenerateColumns(False) _ .Columns(Function(columns) columns.For(Function(c) c.AgreementId).HeaderText("Agreement ID").DataType("number").Hidden(True) columns.For(Function(c) c.AgreementTypeId).HeaderText("Agreement Type").DataType("number").Width(300) columns.For(Function(c) c.SentDate).HeaderText("Sent Date").DataType("date") columns.For(Function(c) c.ReceivedDate).HeaderText("Received Date").DataType("date") columns.For(Function(c) c.EffDate).HeaderText("Effective Date").DataType("date") columns.For(Function(c) c.ExpDate).HeaderText("Expiration Date").DataType("date") End Function) _ .Features(Function(features) features.Sorting().CaseSensitive(False).Mode(SortingMode.Single).Type(OpType.Local) features.Resizing() features.Filtering.Type(OpType.Local).Mode(FilterMode.Simple) features.Selection().Mode(SelectionMode.Row).MultipleSelection(False) features.Updating().ShowDoneCancelButtons(True).DeleteRowTooltip("Delete Agreement").EnableAddRow(True).EnableDeleteRow(True).AddRowLabel("Add Agreement").AddRowTooltip("Add Agreement").EditMode(GridEditMode.Row).ColumnSettings(Function(column) column.ColumnSetting.ColumnKey("AgreementTypeId").EditorType(ColumnEditorType.Combo).Required(True).Validation(True).ComboEditorOptions(Function(combo) combo.Mode(ComboMode.DropDown).SelectItemBySpaceKey(True).EnableClearButton(False).DropDownOnFocus(True).TextKey("AgreementType").ValueKey("AgreementTypeId").DataSource(ViewData("AgreementTypes")) End Function) column.ColumnSetting.ColumnKey("SentDate").EditorType(ColumnEditorType.DatePicker) column.ColumnSetting.ColumnKey("ReceivedDate").EditorType(ColumnEditorType.DatePicker) column.ColumnSetting.ColumnKey("EffDate").EditorType(ColumnEditorType.DatePicker) column.ColumnSetting.ColumnKey("ExpDate").EditorType(ColumnEditorType.DatePicker) End Function) End Function) _ .AutoCommit(True) _ .UpdateUrl(Url.action("UpdateAgreements")) _ .DataSource(ViewData("Agreements")) _ .RenderCheckboxes(True) _ .DefaultColumnWidth("100") _ .GenerateCompactJSONResponse(False) _ .Width("100%") _ .Height("400px") _ .DataBind() _ .Render()) <p> <input type="submit" id="Save" value="Save" class="ui-button" />
Thanks in advance!
Hi,
You should enable this feature by setting the aggregateTransactions property to true.
AggregateTransactions is property of $.ig.DataSource that's why you don't see it in igGrid API.
Here is the description of aggregateTransactions property:
aggregateTransactions
Type:
bool
Default:
false
If set to true, the following behavior will take place:
if a new row is added, and then deleted, there will be no transaction added to the log
if an edit is made to a row or cell, then the value is brought back to its original value, the transaction should be removed.
Note: Keep in mind that if you update row and then delete it you will end up with two transactions.
Hope this helps,
Martin Pavlov
Infragistics, Inc.
I tired this but still I am getting the same result. two transactions for added New Row and deleted the same.
In the above code, I updated the following line.
.DataSource(ViewData("Agreements")).AggregateTransactions(True) _
Hello pardeepkgupta,
Can you tell us which of our samples you tested or isolate and attach your sample for our review?
Thank you.
The sample I tested is in following location.
Grid->EditingAndSelection->BatchingUpdate -> MVC
a quick solution will be highly appreciated.
Thanks!
Can you tell me which build of version 12.1 you use and did you install the latest Service Release for our jQuery controls?
we were using 12.1.2049. Is there any service release after this? if yes, I didn't update that!
i just realize that this the post is from a year ago...sorry
i manage to solve the issue by creating a clean up function
here it is
private void LimparLixoTransaction(List<Transaction<VMProcessoHardware>> transactions) { List<Transaction<VMProcessoHardware>> NewTransactions = transactions; List<Transaction<VMProcessoHardware>> TransactionsToDelete = new List<Transaction<VMProcessoHardware>>(); for (int i = 0; i < NewTransactions.Count-1; i++) { if (NewTransactions[i].type == "newrow") { for (int j = i + 1; j < NewTransactions.Count; j++) { if (NewTransactions[j].type == "deleterow" && NewTransactions[j].rowId == NewTransactions[i].rowId) { TransactionsToDelete.Add(NewTransactions[i]); TransactionsToDelete.Add(NewTransactions[j]); } } } } foreach (Transaction<VMProcessoHardware> t in TransactionsToDelete) { transactions.Remove(t);
}
what it do is basically find a new and a delete row with the same id..
and then delete those rows...
it is working for me...
I am also facing the same issue. I am also using the API(20122). Save changes is submitting the all Transactions instead of aggregrating all Transactions. Please let us know is there any work around
Same issue here. Used the js API(2012.2) rather than the assembly. Added:
$("#grid1").igGrid({aggregateTransactions : true,
...
into BatchingUpdate.html sample.
SaveChanges always submitting all transactions rather than aggregated transactions.
Thanks
I have assembly version 3.11.2.2153 of Infragistics.Web.Mvc.dll.
I also facing same issue of submittig all transaction.
As of now i am referring last trascation to make it work.
But i need actual solution to resolve this issue.
Thanks,
Nirav Kanakhara