1

I have table defined with HTML-helper in my MVC-project:



    @(Html.Infragistics().Grid(Model.SapCrossRefs).ID("GridSapCrossRefs")
              .Width("100%")
              .AutoGenerateColumns(false)
              .AutoGenerateLayouts(false)
              .RenderCheckboxes(false)
              .PrimaryKey("SapCrossRefId")
              .AutoCommit(false)
              .Columns(column =>
              {
                  column.For(x => x.SapCrossRefId).HeaderText("").Width("15%").Template(buttonTemplate);
                  column.For(x => x.Vendor).ColumnCssClass("td-vendorName").HeaderText("Vendor").Width("35%");
                  column.For(x => x.VendorPartNumber).ColumnCssClass("td-vendorPartNumber").HeaderText("Vendor Part #").Width("25%");
                  column.For(x => x.SapProductPartNumber).ColumnCssClass("td-sapPartNumber").HeaderText("Sap Part #").Width("25%");
              }).Features(feature =>
              {
                  feature.Updating()
                  .StartEditTriggers(GridStartEditTriggers.None)
                  .EnableDeleteRow(false)
                  .ColumnSettings(cs =>
                  {
                      cs.ColumnSetting().ColumnKey("SapCrossRefId").ReadOnly(true);
                      cs.ColumnSetting().ColumnKey("Vendor")
                       .EditorType(ColumnEditorType.Combo)
                       .Required(true)
                       .ComboEditorOptions(co =>
                        co.DataSource(Model.Vendors)
                        .ValueKey("VendorId")
                        .TextKey("Name")
                        .Mode(ComboMode.DropDown)
                        .EnableClearButton(false));
                      cs.ColumnSetting().ColumnKey("SapProductPartNumber")
                       .EditorType(ColumnEditorType.Combo)
                       .Required(true)
                       .ComboEditorOptions(co =>
                        co.DataSource(Model.SapProducts)
                        .ValueKey("Id")
                        .TextKey("Name")
                        .Mode(ComboMode.DropDown)
                        .EnableClearButton(false));  cs.ColumnSetting().ColumnKey("VendorPartNumber").Required(true).TextEditorOptions(o => o.ValidatorOptions(vo => vo.MinLength(1)));
                  });
                  feature.Sorting();
                  feature.Paging().Type(OpType.Local).PageSize(15);
              })
              .DataSourceUrl(Url.Action("GetSapCrossRefList"))
              .UpdateUrl(Url.Action("SaveSapCrossRef"))
              .DataBind()
              .Render()
        )


I'm trying enable editing row on clicking "Edit" button. According with documentation I've bind igGridUpdating method on button click:



    function editRow(rowId) {
            $('#GridSapCrossRefs').igGridUpdating('startEdit', rowId, 1);
        }


but this doesn't work. From Chrome console this method returns 'true' but the row does not enter the edit mode, seems that nothing happens.

Is there any way to start editing row programmatically?

Konstantin Dinev
  • 34,219
  • 14
  • 75
  • 100
Reci
  • 85
  • 9
  • What version of Ignite UI are you using? – Konstantin Dinev May 09 '17 at 08:59
  • I'm asking because the answer could differ depending on whether you're using version prior to 15.2. – Konstantin Dinev May 10 '17 at 12:43
  • Version of Infragistics.Web.Mvc is 5.15.1.2410 according to Visual Studio properties window. – Reci May 15 '17 at 10:07
  • Thanks! So that is 15.1. We will look into it to try to give you an answer today. FYI we've reworked editing in 15.2, so if you can upgrade your version to 15.2 plus, you will not be getting this for sure. – Konstantin Dinev May 15 '17 at 12:00
  • It's still the correct way to do this for 15.1. The rework didn't affect the API except for improving error handling in some ways. I managed to create a small app with your configuration and updating started correctly. So it's a little bit puzzling as to what might be causing it to both return true and actually not start edit mode. One possible reason could be type mismatch between the PK's type and the rowId you send to startEdit. Please, ensure you are not getting any other errors in the console. You could also create a case @ https://www.infragistics.com/my-account/submit-support-request – Stamen Stoychev May 16 '17 at 15:46

1 Answers1

0

Finally, it now works without any modification. I've spent about 2 days to figure out why it wasn't working but didn't reach success.

Thanks to Konstantin Dinev and Stamen Stoychev

Community
  • 1
  • 1
Reci
  • 85
  • 9