JavaScript UI Libraries & Blazor Components Suite – Smart UI Forums Data Grid Edit one cell and update another in a different row (live view with edition)

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #104528
    Jose Garcia
    Participant

    Hello everyone,

    When you are editing a cell there is some way to update the data to another cell in a different row without losing the editor of the cell in editing.

    I have tried in different ways but always lost the editor of the cell in edit

    eg 1 :
    grid.updateRow(1,{“firstName”:”Nancy”,”lastName”:”Davolio”,”age”:32});

    eg 2 :
    grid.setCellValue(1,”firstName”,”new value”);

    eg 3 :
    grid.dataSource[x].firstName = value;

    eg 4 :
    grid.rows[x].data[“firstName”] = value;

    Some option?

    Thansk you!!

    #104533
    ivanpeevski
    Participant

    Hi Jose,

     

    You can prevent the grid from updating by first calling grid.beginUpdate(). For example, this will update the value(internally, but not visually) without interrupting the cell editing:

    grid.beginUpdate();

    grid.setCellValue(2, ‘quantity’, 15);

     

    To update the value visually(but not internally), the only possible way is through DOM selection. For example:

    grid.querySelector(‘smart-grid-row[data-id=”2″] smart-grid-cell[data-field=”quantity”] .smart-label’).textContent = “15”

     

    However, the DOM selection will work only if the row is visible. Otherwise, the element will not exist.

     

    Combining the two methods should achieve the desired effect.

     

    Best Regards,
    Ivan Peevski
    Smart UI Team
    https://www.htmlelements.com/

    • This reply was modified 1 year, 1 month ago by ivanpeevski.
    #104571
    Jose Garcia
    Participant

    Hi ,Ivan Peevski
    Thanks!!

    And is there any property or function to know if there is any active editor in any cell?

    #104577

    Hi,

    The getEditCells method gets the editing cells when the grid is editing

    Best Regards,
    Svetoslav Borislavov

    Smart UI Team
    https://www.htmlelements.com/

    #104583
    Jose Garcia
    Participant

    ok,
    Thanks!!

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.