Skip to content

Infragistics Community Forum / Web / Ignite UI for jQuery / Making a row editable dynamically

Making a row editable dynamically

New Discussion
Singh
Singh asked on Feb 13, 2018 4:09 PM

Hi,

I have 3 bands in igHierarchicalGrid. I have few columns which are editable in the second band.

I am using the default row level editing with Done and Cancel buttons. After SaveChanges is called on the Done button click I want to refresh the grid, expand it and make one of the cells in a row to be editable dynamically.

I am calling

grid.igHierarchicalGrid("dataBind"); which refreshes the grid but I am not able to edit the row without again clicking on it.

I want to make a row editable dynamically which has a particular ID as primary key just after the grid is refreshed and expanded.

I am able to refresh and expand the grid.

I have tried using StartEdit but it needs endEdit which I don't want to call:

gridUpdating.startEdit(row.Id, "Comment");

Can you please suggest something?

Regards

Singh

Sign In to post a reply

Replies

  • 0
    Singh
    Singh answered on Jan 3, 2018 8:07 PM

    In addition to the above issue:

    My grids are load on demand. As per the requirements, when I refresh the grid I need to append a custom text to one of the cells in the column.

    It refreshes the grid with the custom value, now if the user clicks the row manually to make it editable ( because I am not able to make it editable dynamically), the Done button remains disabled unless a value is changed in the that row. I want Done button to be enabled so that it can go into save changes.

    Regards

    Singh

    • 0
      Singh
      Singh answered on Feb 5, 2018 11:15 AM

      Hi,

      Can anyone please reply to this?

      Regards

      Singh

  • 0
    Vasil Pavlov
    Vasil Pavlov answered on Jan 5, 2018 4:24 PM

    Hello, Singh

     

    Thank you for posting in our forum!

    If the startEdit method requires endEdit, there is a chance you are incorrectly targeting the parent grid instead of the child one and because the editing hasn’t finished, it throws an error.

    When you expand your child grid, the “expand” method has a callback function which you may use to edit the rows programmatically. Here’s how do to it:

    • Inside the callback use the “allChildren” method to get a flat list of all child grid elements
    • After that – jQuery’s eq() method to reduce the list to a single object.
    • Then call “startEdit” with the ID of the row you want to edit.

    I made a small sample, check it out.

     

    Best Regards,

    Vasil Pavlov

    Associate Software Developer

    Infragistics, Inc.

    http://pt-br.infragistics.com/support

     

    
    HierarchicalGrid
    
    
    
    
    
    
    
    
    
    
        

    • 0
      Singh
      Singh answered on Jan 29, 2018 4:07 PM

      hi,

      I tried the above but I get the following error:

      "Editing the specified row or column is currently not possible. It should be in view on the current page and virtualization frame.

      My code is as below:

      $(document).delegate("#igGrid", "iggriddatarendered", function (evt, ui) {

       if (expandAll === true) {

      var parentGrid = $("#igGrid").igHierarchicalGrid("rootWidget");

      var domElement = parentGrid.rowById(rowID);

      if (domElement != null) {

      $("#igGrid").igHierarchicalGrid("expand", domElement, function () {

      //updating the first row of the first child table

      var children = $("#igGrid").igHierarchicalGrid("allChildren");

      children.eq(0).igGridUpdating("startEdit", currentTradeIdFileTypeId);

      });

      }

         }

      });

      • 0
        Singh
        Singh answered on Feb 5, 2018 11:15 AM

        Hi,

        Can anyone please reply to this?

        Regards

        Singh

      • 0
        Vasil Pavlov
        Vasil Pavlov answered on Feb 5, 2018 4:44 PM

        Hello Singh,

         

        This error message gets thrown when the igGrid control couldn’t find the row or column you are trying to edit – usually when it doesn’t exist in the browser’s DOM because of the virtualization or paging.

        How do you initialize the “currentTradeIdFileTypeId” variable that you are using in the “startEdit” method? If you haven’t set it properly, it might be the cause of the issue.

         

        If you need any additional assistance, feel free to contact me.

         

         

        Best Regards,

        Vasil Pavlov

        Associate Software Developer

        Infragistics, Inc.

      • 0
        Singh
        Singh answered on Feb 7, 2018 3:30 PM

        Hi Vasil,

        I have checked what you suggested but currentTradeIdFileTypeId always has the correct value. It is set somewhere above in the code. Can you please suggest something else?

        Regards

        Singh

      • 0
        Vasil Pavlov
        Vasil Pavlov answered on Feb 13, 2018 4:09 PM

        Hello Singh,

         

        There could be some other thing in the code that is causing the issue and which I am missing, but it is not possible to know without the whole grid configuration and the event handlers that you are using.

        Is there a way for you to provide me with an isolated code sample? Or modify the sample I sent you with your settings and event handlers and send it back to me?

         

         

        Best Regards,

        Vasil Pavlov

        Associate Software Developer

        Infragistics, Inc.

  • You must be logged in to reply to this topic.
Discussion created by
Favorites
Replies
Created On
Last Post
Discussion created by
Singh
Favorites
0
Replies
8
Created On
Feb 13, 2018
Last Post
8 years, 1 month ago

Suggested Discussions

Created by

Created on

Feb 13, 2018 4:09 PM

Last activity on

Feb 13, 2018 4:09 PM