Results 1 to 2 of 2

Thread: How to update a cell value based on other cell - Ext.grid.plugin.CellEditing

  1. #1
    Sencha Premium Member Alex.Muntean@im-c.com's Avatar
    Join Date
    Nov 2013
    Posts
    10

    Question How to update a cell value based on other cell - Ext.grid.plugin.CellEditing

    Hey everyone,

    I'm trying to develop a data table, with cells that can be edited. For this table I need that a specific cell to be updated, based on other cells, therefore to be bind with other cells.

    I made a basic application: https://fiddle.sencha.com/#view/editor&fiddle/2nqa

    In the previous link you can find a fiddle app, where there is developed a table with months, quarters and total sum.
    For the last column, total, I need to update the its value by summing up all other cells on that row. When a cell is changed, the total cell should be updated.

    The question comes, how can I bind total column with values of corresponding cells?

    I see that on listener I have access to editor, but not sure how can I update a specific cell.


    Can some one give me some hints/support on this?

    Regards,
    AlexM

  2. #2
    Sencha Premium Member Alex.Muntean@im-c.com's Avatar
    Join Date
    Nov 2013
    Posts
    10

    Default

    No answer, but I found a way to do this.

    Code:
    validateedit: function (ed, e, eOpts) {
          // Update a specific row cell
           ed.grid.store.data.items[0].store.data.items[0].data["Apr"] = 5
    
          //Update Total column from the edited row
          e.record.data["Total"] = 123;
          //Need to update the view, with the new values assigned to total
          ed.grid.getView().refresh()
    }
    validateedit is a listener of cellediting edit plugin

Similar Threads

  1. Replies: 5
    Last Post: 28 Mar 2012, 8:30 PM
  2. How to update grid cell value based on other cell's text?
    By jayanthy.kapistalam in forum Ext: Discussion
    Replies: 0
    Last Post: 25 Jul 2011, 11:11 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •