Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
310
ig grid: "UpdateUrl" method is not called
posted

Hello,

I'm using infragistic for the first time in anc asp.net MVC application.

I'm using an ig grid. but when I add, delete or update a row, there is not a call on my

"UpdateUrl" method in server side.

can some one help m please.

Here is the code on my View:

<script>

$('#igGrid1').on('iggridupdatingrowadded', function () {

$('#igGrid1').igGrid("saveChanges")

});

$('#igGrid1').on('iggridupdatingeditrowended', function (event, ui) {

if(ui.rowAdding == false){

$('#igGrid1').igGrid("saveChanges");

}

});

$('#igGrid1').on('iggridupdatingrowdeleted', function () {

$('#igGrid1').igGrid("saveChanges")

});

</script>

@model System.Linq.IQueryable<InfragisticLastTest.Controllers.Student>

<h2 class="text-center">Students Data </h2>

@(Html.Infragistics()

.Grid<InfragisticLastTest.Controllers.Student>(Model)

.AutoGenerateColumns(true)

.ID("igGrid1")

.PrimaryKey("StudentId")

.Columns(column =>

{

column.For(x => x.StudentId).DataType("string").HeaderText("Student ID");

column.For(x => x.FirstName).DataType("string").HeaderText("First Name");

column.For(x => x.LastName).DataType("string").HeaderText("LastName Name");

column.For(x => x.Age).DataType("int").HeaderText("Student Age");

column.For(x => x.Adresse).DataType("string").HeaderText("Student Address");

}

)

.Features(features =>

{

features.GroupBy().Type(OpType.Remote);

features.Paging().PageSize(2);

features.Sorting().Mode(SortingMode.Multiple);

features.Filtering().Mode(FilterMode.Advanced);

features.Updating().EditMode(GridEditMode.Row).EnableAddRow(true).EnableDeleteRow(true).StartEditTriggers(GridStartEditTriggers.DblClick).DoneLabel("Submit");

})

.UpdateUrl(Url.Action("UpdateStudent", "Home"))

.DataBind()

.Render())

Parents
No Data
Reply
  • 5513
    Offline posted

    Hello,

    Thank you for using Infragistics forums!

    Without a sample reproducing the issue I can't be certain but it is likely that the script binding to the events e.g.:

    "$('#igGrid1').on('iggridupdatingrowadded'function () {"

    is being executed before the grid's element is created by the MVC helpers. To check if this is the case you could delegate the event to an element that is will most definitely be available (such as document). Like this:

    $("document").on('iggridupdatingrowadded', '#igGrid1', function () {"

    I hope this helps! Please, let me know if you have any other questions or concerns!

    Best regards,

    Stamen Stoychev

Children
No Data