Results 1 to 4 of 4

Thread: RowEditing does not fire any event ...

  1. #1
    Sencha User
    Join Date
    Dec 2011
    Location
    Braunschweig, Germany
    Posts
    18
    Answers
    1
    Vote Rating
    0
      0  

    Question Answered: RowEditing does not fire any event ...

    Hi everyone,

    I'm kind of new to ExtJS (working about 2 weeks on it now) and I'm building an application to manage employees.

    There only one last step missing to finish the task; i just can't update an employee.
    It worked until yesterday, when I threw together different pages to one editorgrid (there were about 4 or 5 pages, which just sucked in my opinion, so I decided to redesign it ).

    I got the RowEditing plugin set up (and as I said before, when I had a single page per task, it worked fine), but when I click on "Update", the record only gets marked as dirty.
    No Request or whatever is made to the server.
    Here's the code for my RowEditing:

    Code:
        var rowEditing = Ext.create('Ext.grid.plugin.RowEditing', {
          clicksToMoveEditor: 1,
          autoCancel: false,
          listeners: function(e) {
            Ext.Ajax.request({
              url: '/app/aendernPage',
              params:  {
                id : e.record.get('id'),
                firstName: e.record.get('firstName'),
                lastName:  e.record.get('lastName'),
                birthday:  e.record.get('birthday'),
                age:  e.record.get('age'),
                gender:  e.record.get('gender'),
                skillGroups:  e.record.get('skillGroups')
              },
              method: 'GET',
              success: function() {
                Ext.MessageBox.alert("Das hat geklappt!", "Daten gendert...");
                window.location.reload();
              }
            })
    
          }
    
        });
    And here's the grid where I'm using it:

    Code:
     grid = {
          xtype: 'grid',
          selType : 'rowmodel',
          columns: columnModel,
          plugins: [rowEditing],
          store: jsonStore,
          id: 'grid',
          forceFit: true,
          height: 400,
          enableColumnResize: true,
          tbar:
              [
                {
                  itemId: 'createEmployee',
                  text: 'Erzeugen',
                  handler: function(e) {
                    win = new Ext.Window(
                        {
                          layout: 'fit',
                          width: 900,
                          height: 300,
                          modal: true,
                          closeAction: 'hide',
                          items: new Ext.Panel(
                              {
                                items: [inputWindow]//Your items here
                              })
                        }).show();
    
    
                  }
                },
                {
                  itemId: 'showAll',
                  text: 'Tabelle aktualisieren',
                  handler: function(e) {
                    jsonStore.load({url: '/app/ausgabeJson'});
                  }
                },
                {
                  itemId: 'removeEmployee',
                  text: 'Lschen',
                  handler: function(e) {
                    var grid = e.ownerCt.ownerCt;
                    var sm = grid.getSelectionModel();
                    var record = sm.getSelection()[0];
    
                    Ext.Ajax.request({
                      url: '/app/loeschenPage',
                      params:
                      {
                        id: record.get('id')
                        // firstName: record.get('firstName')
                      },
                      method: 'GET',
                      success: function() {
                        Ext.MessageBox.alert("Und tschss...", "Mitarbeiter erfolgreich aus der Datenbank gelscht.");
                        window.location.reload();
                      }
                    })
    
                  }
                       }
              ]
        };
    I know there may be some points to work on in general, but I want to have it up and running first

    Can anyone tell me where my mistake is? Or what I should be doing completely different?

    Thanks in advance
    gilaras

    P.S.: If you need more information/code samples, please let me know. I'm not sure what exactly is needed to give you all the information you need

  2. listeners is a config to add events, not a function directly.
    http://docs.sencha.com/ext-js/4-0/#!...ing-event-edit

    Code:
    listeners: {
        edit: function(...){
            ...
        }
    }

  3. #2
    Sencha User tobiu's Avatar
    Join Date
    May 2007
    Location
    Munich (Germany)
    Posts
    2,751
    Answers
    130
    Vote Rating
    129
      0  

    Default

    listeners is a config to add events, not a function directly.
    http://docs.sencha.com/ext-js/4-0/#!...ing-event-edit

    Code:
    listeners: {
        edit: function(...){
            ...
        }
    }
    Best regards
    Tobias Uhlig

  4. #3
    Sencha User
    Join Date
    Dec 2011
    Location
    Braunschweig, Germany
    Posts
    18
    Answers
    1
    Vote Rating
    0
      0  

    Default Solved...

    Hi,

    thank you very much
    That solved my problem

    But what I'm kind of confused about; why did it work before I merged all files into one "big" application?

  5. #4
    Sencha User tobiu's Avatar
    Join Date
    May 2007
    Location
    Munich (Germany)
    Posts
    2,751
    Answers
    130
    Vote Rating
    129
      0  

    Default

    honestly, i have no clue. definining listeners with a function will never work.
    Best regards
    Tobias Uhlig

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
  •