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
65
Enabling editing of a cell based on other cell value dynamically.
posted

Hi Guys,

I have an ig-grid with 10 columns in which 5 columns are editable and 5 are read only. I'm handling this via editCellStarting.

Among the editable columns is a dropdown/igcombo and upon the option selected from the dropdown, I need to enable the editing for one of the columns which was earlier read-only/disabled. I have the selectionChanged event of the igcombo but not sure how I can get the cell to be editable.

I tried the following but it's not working. It throws an error saying an edit is already in progress.

$('#grid1').igGridUpdating('startEdit', 1, 1); 

Appreciate your help.

Thanks,

Shahrukh

Parents
  • 17590
    Offline posted

    Hello Shahrukh,

    Thank you for posting in out community.

    In order to ensure that I will provide you with the most accurate support I will need some additional information regarding your scenario. Can you please answer the following questions:

    • What is your edit mode, is it "row", "cell" or "dialog"?
    • What is the condition that you check in the editCellStarting event? Is it just the column key or you are checking for some of the other cell values? For example:

                          editCellStarting: function(evt, ui){
                                if(ui.columnKey == "FirstName" || ui.columnKey == "LastName") {
                                       return false;
                                 }
                          }

                       or

                     editCellStarting: function(evt, ui){
                                if(ui.columnKey == "FirstName" && [other_cell_value] === 5) {
                                       return false;
                                 }
                      }

    • Would you like to just set this column as editable for future edits or you would like to end edit mode for the current column and enter edit mode for the column that you have just enabled for editing?

    This information is going to be highly appreciated and will help me decide how we should proceed further.

    Looking forward to hearing from you.

Reply Children