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,
There is a new Service Release (build 2059) that is now available for download through our Website.
Make sure that you change the reference to our MVC assembly in your project to point the newest version before testing this behavior again.
Hi Alex,
I downloaded new release but still not getting net transactions.
what I did for new release is: replaced js folder and css folder with the latest one's.
I did not updated the reference to new Infragistics.Mvc.dll. Actually we downloaded the source code and customize it to suit our requirements. If this reference needs to be updated, can you please send me the changes in source code of this dll, so that we could update only those parts which required.
Thanks!
Since you are using our MVC wrapper you should update the assembly reference and/or assembly itself in order to see the difference.
The changes made between versions are too many to be summarized in few lines but you can download the new version of the Source Code too and made/check the needed changes there.
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
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 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