• 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.

rowedit plugin not working

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

  • rowedit plugin not working

    I am about as confused as I've been working with extjs. I've used this in dozens and dozens of apps with no issue. In this one, it keeps throwing error that getEditor is not a function. You normally get that when you forget to add the plugin, not the case here. I've compared code to apps where it works fine, it's identical. You guys see anything here?

    Code:
     
     Ext.define('PRE.view.ResultsNotesGrid',{    extend : 'Ext.grid.Panel',     alias : 'widget.resultsnotesgrid',     loadMask: false,     preventHeader: true,    bodyBorder: false,     frame: true,     PNPRE: ' ',     viewConfig: {        forceFit: true,        emptyTextPlugin: false,       enableRowBody: true,       emptyText: '<center>There are no result notes.</center>'    },    selType: 'rowmodel',    plugins: [             Ext.create('Ext.grid.plugin.RowEditing', {                 clicksToEdit: 2             })     ],     initComponent : function(){         //this.contextMenu = this.buildContextMenu();         this.store = Ext.getStore('resultnotes');         this.dockedItems = this.buildDockedItems();         this.columns = this.buildColumns();         this.callParent(arguments);        var tg = this;                  this.getStore().on({             scope: this,             beforeload: function(st) {                 st.getProxy().extraParams  = {                    pgm: 'VALV189',                  action: 'getResultNotes',                       pre : this.PNPRE                 };             }         });                  this.on({             scope: this,             edit: function(editor, e) {                 this.updateNote(e.record);          }         });              },          updateNote : function(record) {                var parms = {             pgm: 'VALV189',             action: 'updNote',           pre: this.PNPRE,          seq: record.get('PNSEQ'),          type: record.get('PNTYPE'),          text: record.get('PNTEXT')         };          Ext.Ajax.request({             url: '/valence/vvcall.pgm',             params: parms,             scope: this,          success: function(response) {                var check = response.responseText;                if (check) {                   var data = Ext.decode(response.responseText);                   if (data.SUCCESS === '1') {                      record.commit();                      //this.down('itemnotesgrid').getStore().load();                   } else {                      Ext.Msg.alert('ERROR-', data.MSG);                   }                } else {                   Ext.Msg.alert('ERROR OCCURED', 'Received a null response from the server when attempting to update a record.');                }             },          failure: function() {                Ext.Msg.alert('ERROR OCCURED', 'Received a failure response from the server when attempting to update a record.');             }          });       },           buildDockedItems : function(){         return [{             xtype : 'toolbar',             dock : 'top',             itemId : 'tbar',             defaults: {                 xtype: 'button'             },             items : [{                itemId: 'btnAddResNote',                 xtype: 'button',               text: 'New Result Note',               tooltip: 'add a new result note',               iconCls: 'add',                 scope: this,               handler: this.addResultNote            }]       }];     },          addResultNote: function() {        //console.log(this);       var type = 'R';         this.fireEvent('addresnote',type);     },          buildColumns : function(){         return [{             header: 'Delete',             xtype: 'actioncolumn',             align: 'center',             width: 50,             sortable: false,             items: [{                icon: 'http://10.29.231.57:7040/resources/icons/silk/delete.gif',                itemId: 'actionresnotedel',                scope: this,                handler: function(grid, rowIndex) {                   var rec = grid.getStore().getAt(rowIndex);                   //console.log('handler fired', rec.get('INITEM'));                  this.fireEvent('delClick', rec);                 }              }]          },{           dataIndex: 'PNPRE',          hidden: true       }, {          header: '<b>Seq No</b>',           width: 80,           sortable: false,           dataIndex: 'PNSEQ',          renderer: function(val, x, store){             return '<div class="vv-griddescription">' + val + '</div>';          }       }, {           header: '<b>Note Text</b>',           width: 350,           sortable: false,           dataIndex: 'PNTEXT',           editor: {             xtype: 'textarea',             allowBlank: false,             grow: true,             maxLength : 3000,             selectOnFocus: true           },           renderer: function(val, x, store){             return '<div class="vv-griddescription">' + val + '</div>';          }       }, {           header: '<b>Created</b>',           width: 80,           sortable: false,           dataIndex: 'PNCRTDT',          renderer: function(val, x, store){             return '<div class="vv-griddescription">' + val + '</div>';          }       }, {          header: '<b>By</b>',          width: 60,          sortable: false,          dataIndex: 'PNCRTUSR',          renderer: function(val, x, store){             return '<div class="vv-griddescription">' + val + '</div>';          }        }];     } });

    Capture.PNG

  • #2
    Ugh, I still don't understand how to get that code to look good. Loses all the spacing/indentation I have in WebStorm. Sorry about that. :(

    Comment


    • #3
      Terry, can you just post back the code that you have for "onCellClick"?

      Comment


      • #4
        Hi Sean. I'm a little confused what you mean. All I did was use the editor config on column like I always do. I attached the full code for grid as attachment, so you can see whole picture. Thanks for looking at.

        Code:
        header: '<b>Note Text</b>',
        width: 350,
        sortable: false,
        dataIndex: 'PNTEXT',
        editor: {
        xtype: 'textarea',
        allowBlank: false,
        grow: true,
        maxLength : 3000,
        selectOnFocus: true
        },
        renderer: function(val, x, store){
        return '<div class="vv-griddescription">' + val + '</div>';
        }
        Attached Files
        Last edited by TerryB; 06-07-2019, 11:59 AM.

        Comment


        • #5
          Sean, I have a theory here, only thing that makes sense. There are 3 grids on the panel, all with rowedit plugin. Each grid has it's own Store, but on server I'm using one file to hold all these notes. So in each store, the names of fields are the same. This field I'm trying to edit is PNTEXT. I'm thinking extjs is confused how to bind this editor because of same name. I don't see what else it could be.

          Should I try and change server/store code and send unique names?

          Comment


          • #6
            Terry, your initial post referenced an error that you were receiving. Based on the console screenshot you posted, your error is taking place in method "onCellClick". I assume that you have a method "onCellClick" in a controller?

            Comment


            • #7
              I found it Sean. Had nothing to do with editor plugin, I had created the panel holding the grids more than once, accidentally had a create command in Controller even though it really gets created by the top level panel as an xtype. I noticed some other flaky behavior, then put a console log in beforeload on grid. It fired twice.

              Sorry for false alarm. :(

              Comment


              • #8
                I wasn't completely wrong about the 3 stores trying to use the same "object" coming from server though. But it doesn't have anything to do with rowedit working. But when I add a record to the 2nd grid, the record in the 1st grid no longer makes to the store to be displayed. As soon as I delete the 2nd grid record, it shows back up.

                I can easily work around this, just would not have expected it to work that way. The store loads are all called at same time, obvious they are walking on each other because of the common object name coming from server. Live and learn.

                Comment


                • #9
                  Just for anyone else reading this basically worthless post, there is no issue having 3 stores use same object from server. I had stupid RPG error on server side sending the data. So only lesson on this post is if rowedit not working, check you did not create the grid twice. That was only issue.

                  Comment

                  Working...
                  X