• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Announcement

Collapse
No announcement yet.

Trigger Grid Edit event when setting value with action column

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Trigger Grid Edit event when setting value with action column

    This is a pure Extjs issue but I can not find the answer with web search. I'm using cellEditing and grid row has an action column that will set a cell's value from another column on record in the action column handler. I then commit to the store. All that is working fine but I can not figure out how to fire the Edit event so listener will post to server and do some additional processing.

    I was hoping the commit method would trigger but it does not. I tried a variety of other things (now commented out) and they either did not work or threw a syntax error getting proper reference to plugin. Thanks in advance for any help.

    this.on({
    scope: this,
    edit: function(editor, e)
    { e.record.commit();
    var recs = this.getStore().getRange();
    this.fireEvent('linetot',recs);


    handler: function(grid, rowIndex)
    { var rec = grid.getStore().getAt(rowIndex);
    //grid.CellEditing().startEditByPosition({row: rowIndex,column: 3});
    rec.set('MPPAYAMT', rec.get('MPOPNAMT'));
    rec.commit();
    //var recs = this.getStore().getRange();
    //this.fireEvent('edit'); }
    Last edited by TerryB; 08-14-2018, 12:07 PM.

  • #2
    Terry,

    Since you're already in the edit event of the cellEditing you could just perform your AJAX request within that method.

    Comment


    • #3
      Actually I do not HAVE to fire Edit event, just need to figure the proper scope usage from the action handler to fire the same "linetot" event the Edit listener is doing. When I tried from handler it was never processed in Controller which listened on the grid events. Guessing scope is not right to get it there.

      I misspoke saying I needed server call, do not at this point. Just trying to execute some code in Controller to total some stuff.

      Comment


      • #4
        Terry,

        Since I am unclear on exactly what you're asking can you just create a Sencha Fiddle that shows the issue you're having? Thanks

        Comment


        • #5
          code example.txt

          Not sure how to create a Fiddle for this, Johnny, complex app in total. But attachment above should give you clearer view of my issue. Note in the "Action Column Code" section I have commented out lines which fire same event as the Edit listener. My problem is that event is not processed by the Controller, guessing scope is all wrong coming from handler. Does this help?

          Comment


          • #6
            Good grief, Johnny. Never mind, now it is working correctly. The controller is processing the event from the handler. I must have done something stupid and that threw me off track to try all kinds of stupid stuff. Sorry. :-(

            Comment

            Working...
            X