Skip to content

Infragistics Community Forum / Web / Ignite UI for jQuery / igGrid: updating and grid.on binding not working when using GridModel?

igGrid: updating and grid.on binding not working when using GridModel?

New Discussion
Pete Sral
Pete Sral asked on Jan 5, 2022 2:56 PM

Following the example on https://www.igniteui.com/grid/basic-editing

I am able to initiate the edit in the igGrid, however, unlike the sample, the events that enable or disable the save, undo and redo are not working.  If I click the saveChanges button, the button does disable. All the examples I have run across are for editing using the Chaining method and not the GridModel.

I feel like there is something I'm missing or overlooking with the GridModel, like I can't mix the code that is used for Chaining with the GridModel and I have to use a different approach for triggering edits?

Here is a snippet of the view code, focusing only on the save button:


 @(Html.Infragistics().Grid(Model))
 
        

Version:

  • Infragistics\2021.1\Ignite UI for MVC\MVC5\Bin\Infragistics.Web.Mvc.dll
  • 5.21.1.17

Thanks in advance,

Pete

Sign In to post a reply

Replies

  • 0
    Monika Kirkova
    Monika Kirkova answered on Jan 4, 2022 12:06 PM

    Hello Pete,

    After investigating this further, I determined that the methods bound to the dataBinding and dataBound events are not called initially, because “var grid” and the methods are defined after the data is bound. The events could be bound to methods as follows:

    $(document).on("iggriddatabinding", "#grid", function (evt, ui) {

        alert("binding")

    });

    Or

    HomeController.cs

    gridModel.AddClientEvent("dataBound", "dataBound");

    Index.cshtml

    function dataBound(evt, ui) {

       alert('bound');

    }

    I have prepared a sample using Grid Model with enabled Updating, the “Save Changes”, “Undo” and “Redo” buttons are enabled and disabled correctly and by pressing “Save Changes”, “commit” method is called and the data is bound to the Grid.

    Below I am attaching a sample, demonstrating the described behavior. Please test it on your side and let me know if you need any further information regarding this matter.

    Regards,
    Monika Kirkova,
    Infragistics

    igGridUpdatingModel.zip

    • 0
      Pete Sral
      Pete Sral answered on Jan 4, 2022 10:34 PM

      With the sample you provided I was able to determine that our project was referencing a newer version of the .js files (21.2), updated via NuGet; however, the  MVC.dll was 2021.1, and once I referenced the correct javascript the binding worked as expected.

      • 0
        Monika Kirkova
        Monika Kirkova answered on Jan 5, 2022 2:56 PM

        Hello Pete,

        I am glad that you were able to resolve your issue.

        Thank you for using Infragistics components.

        Regards,
        Monika Kirkova,
        Infragistics

  • You must be logged in to reply to this topic.
Discussion created by
Favorites
Replies
Created On
Last Post
Discussion created by
Pete Sral
Favorites
0
Replies
3
Created On
Jan 05, 2022
Last Post
4 years, 9 months ago

Suggested Discussions

Created by

Created on

Jan 5, 2022 2:56 PM

Last activity on

Jan 5, 2022 2:56 PM