1. #471
    Sencha - Community Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    27,538
    Vote Rating
    380
    jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future

      0  

    Default


    I've right now tried to run my recordform example page against Ext 3.1.0 and it works. Could you please run your code with Ext 3.0 so that we can isolate the problem?
    Jozef Sakalos, aka Saki

    Education, extensions and services for developers at new http://extjs.eu
    News: Grid Search Plugin, ExtJS 5 Complex Data Binding using MVVM


  2. #472
    Sencha User Dumas's Avatar
    Join Date
    Dec 2008
    Location
    Vienna, Austria
    Posts
    583
    Vote Rating
    9
    Dumas will become famous soon enough

      0  

    Default


    Where can I get ExtJS 3.0? It's not on the Download page anymore....

  3. #473
    Sencha - Community Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    27,538
    Vote Rating
    380
    jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future

      0  

    Default


    Why would you want it?

    PS: You question is not related to RecordForm, so post please general questions in another thread/forum in the future.
    Jozef Sakalos, aka Saki

    Education, extensions and services for developers at new http://extjs.eu
    News: Grid Search Plugin, ExtJS 5 Complex Data Binding using MVVM


  4. #474
    Sencha User Dumas's Avatar
    Join Date
    Dec 2008
    Location
    Vienna, Austria
    Posts
    583
    Vote Rating
    9
    Dumas will become famous soon enough

      0  

    Default


    Quote Originally Posted by jsakalos View Post
    I've right now tried to run my recordform example page against Ext 3.1.0 and it works. Could you please run your code with Ext 3.0 so that we can isolate the problem?
    Wasn't that directed to me?

  5. #475
    Sencha - Community Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    27,538
    Vote Rating
    380
    jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future

      0  

    Default


    I don't know to whom it was addressed, but from the nature of the post I guess that it is Ext 3.0/1 compatibility related so if you had that sort of question then it was addressed also to you.
    Jozef Sakalos, aka Saki

    Education, extensions and services for developers at new http://extjs.eu
    News: Grid Search Plugin, ExtJS 5 Complex Data Binding using MVVM


  6. #476
    Sencha User
    Join Date
    Oct 2009
    Posts
    47
    Vote Rating
    1
    macdoug1 is on a distinguished road

      0  

    Question Can someone look this over and tell me what is wrong?

    Can someone look this over and tell me what is wrong?


    I've been trying to mark-up the plugin to get this working for a solution. I've got it working to the extent where it will display the grid columns and all the functionality except for the icons that appear in the row for deletion and editing. Anyway I'm not sure what is keeping them from appearing and I've gone through this thing a million times with firebug to see and I'm unsure of what is really happening.
    Code:
    Application.PartsInfo = Ext.extend(Ext.grid.EditorGridPanel, {
        stateful: false,
        objName: 'partnum',
        idName:'infID',
        
        initComponent:function(){
            this.recordForm = new Ext.ux.grid.RecordForm({
                    title : 'Row Record Editor',
                    iconCls : 'icon-edit-record',
                    columnCount : 2,
                    ignoreFields : {
                        infID : true
                    },
                    readonlyFields : {
                        action1 : true
                    },
                    disabledFields : {
                        qtip1 : true
                    },
                    formConfig : {
                        labelWidth : 80,
                        buttonAlign : 'right',
                        bodyStyle : 'padding-top:10px'
                    }
            });
    
            this.checkColumn = new Ext.grid.CheckColumn({
                header:'HAZMAT?',
                dataIndex:'hazmat',
                width:70
            });
            
            //create row actions
            this.rowActions = new Ext.ux.grid.RowActions({
                 actions:[{
                     iconCls:'icon-minus'
                    ,qtip:'Delete Record'
                },{
                     iconCls:'icon-edit-record'
                    ,qtip:'Edit Record'
                }]
                ,widthIntercept:Ext.isSafari ? 4 : 2
                ,id: 'actions'
            });
            this.rowActions.on('action', this.onRowAction, this);
            
            Ext.apply(this, {
                store: new Ext.data.Store({
                    autoDestroy: true,
                    reader : new Ext.data.JsonReader({
                                id : 'infID',
                                totalProperty : 'totalCount',
                                root : 'rows',
                                fields : [{
                                            name : 'infID',
                                            type : 'int'
                                        }, {
                                            name : 'partnum',
                                            type : 'string'
                                        }, {
                                            name : 'site'
                                            
                                        }, {
                                            name : 'program'
                                            
                                        }, {
                                            name : 'partdesc',
                                            type : 'string'
                                        }, {
                                            name : 'production',
                                            type : 'string'
                                        }, {
                                            name : 'pstcode'
                                            
                                        }, {
                                            name : 'qclauses',
                                            type : 'string'
                                        }, {
                                            name : 'action1',
                                            type : 'string'
                                        }, {
                                            name : 'qtip1',
                                            type : 'string'
                                        }, {
                                            name : 'hazmat',
                                            type : 'bool'
                                        }
    
                                ]
                            }),
                    proxy : new Ext.data.HttpProxy({
                                url : "static/data/data1.json"
                            }),
                    baseParams : {
                        cmd : 'getData',
                        objName : this.objName
                    },
                    sortInfo : {
                        field : 'partnum',
                        direction : 'ASC'
                    },
                    remoteSort : true,
                    listeners : {
                        load : {
                            scope : this,
                            fn : function(store) {
    
                                // keep modified records accros paging
                                var modified = store.getModifiedRecords();
                                for (var i = 0; i < modified.length; i++) {
                                    var r = store.getById(modified[i].id);
                                    if (r) {
                                        var changes = modified[i].getChanges();
                                        for (p in changes) {
                                            if (changes.hasOwnProperty(p)) {
                                                r.set(p, changes[p]);
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }),
                columns:[{
                    header : 'Part Number',
                    id : 'partnum',
                    dataIndex : 'partnum',
                    width : 135,
                    editor : new Ext.form.TextField({
                                allowBlank : false
                            }),
                    sortable : true
                }, {
                    header : 'Site',
                    dateIndex : 'site',
                    width: 60,
                    editor : new Ext.form.ComboBox({
                                typeAhead:true,
                                triggerAction:'all',
                                lazyRender:true,
                                mode:'local',
                                store:siteDs,
                                valueField:'id',
                                displayField:'siteLocation'
                            }),
                    sortable : true
                }, {
                    header : 'Program',
                    dataIndex : 'program',
                    width : 130,
                    editor : new Ext.form.ComboBox({
                                typeAhead:true,
                                triggerAction:'all',
                                lazyRender:true,
                                mode:'local',
                                store:programDs,
                                valueField:'id',
                                displayField:'program'
                            }),
                    
                    sortable : true
                }, {
                    header : 'Part Description',
                    width : 300,
                    editor : new Ext.form.TextField({
                                allowBlank : false
                            }),
                    dataIndex : 'partdesc',
                    sortable : true
                }, {
                    header : 'Production',
                    dataIndex : 'production',
                    width : 80,
                    editor : new Ext.form.ComboBox({
                                store:new Ext.data.SimpleStore({
                                    id:0,
                                    fields:['production'],
                                    data:[
                                        ['Yes'],
                                        ['No']
                                    ]
                                }),
                                typeAhead:true,
                                triggerAction:'all',
                                mode:'local',
                                editable:false,
                                forceSelection:true,
                                valueField:'production',
                                displayField:'production'
                            }),
                    
                    sortable : true
                }, {
                    header : 'PST Code',
                    dataIndex : 'pstcode',
                    width : 80,
                    editor : new Ext.form.ComboBox({
                                typeAhead:true,
                                triggerAction:'all',
                                lazyRender:true,
                                mode:'local',
                                store:pstDs,
                                valueField:'pstNameDisplay',
                                displayField:'pstNameDisplay'
                            }),
                    
                    sortable : true
                }, {
                    header : 'Quality clauses',
                    width : 180,
                    editor : new Ext.form.TextField({
                                allowBlank : true
                            }),
                    dataIndex : 'qclauses',
                    sortable : true
                },this.checkColumn,this.rowActions]
                ,plugins:[new Ext.ux.grid.Search({
                    iconCls : 'icon-zoom',
                    readonlyIndexes : ['program'],
                    disableIndexes : ['hazmat']
                }),this.rowActions,this.recordForm,this.checkColumn]
                ,viewConfig:{forceFit:true}
                ,buttons: [{
                     text:'Save'
                    ,iconCls:'icon-disk'
                    ,scope:this
                    ,handler:this.commitChanges
                },{
                     text:'Reset'
                    ,iconCls:'icon-undo'
                    ,scope:this
                    ,handler:function() {
                            this.store.each(function(r) {
                                r.reject();
                            });
                            this.store.modified = [];
        //                    this.store.rejectChanges();
                    }
                }]
                ,tbar:[{
                     text:'Add Record'
                    ,tooltip:'Add Record to Grid'
                    ,iconCls:'icon-plus'
                    //,id:'btn-add'
                    ,listeners:{
                        click:{scope:this, fn:this.addRecord,buffer:200}
                    }
                },{
                     text:'Add Record'
                    ,tooltip:'Add Record with Form'
                    ,iconCls:'icon-form-add'
                    ,listeners:{
                        click:{scope:this, buffer:200, fn:function(btn) {
                            this.recordForm.show(this.addRecord(), btn.getEl());
                        }}
                    }
                }]
            });//eo apply
            
            this.bbar = new Ext.PagingToolbar({
                 store:this.store
                ,displayInfo:true
                ,pageSize:10
            });
            
            //call parent
            Application.PartsInfo.superclass.initComponent.apply(this,arguments);
        }//eo function initComponent
        ,onRender:function() {
            // call parent
            Application.PartsInfo.superclass.onRender.apply(this, arguments);
    
            // load store
            this.store.load({params:{start:0,limit:10}});
            
    
        } // eo function onRender
        // }}}
        // {{{
        ,addRecord:function() {
            var store = this.store;
            if(store.recordType) {
                var rec = new store.recordType({newRecord:true});
                rec.fields.each(function(f) {
                    rec.data[f.name] = f.defaultValue || null;
                });
                rec.commit();
                store.add(rec);
                return rec;
            }
            return false;
        } // eo function addRecord
        // }}}
        // {{{
        ,onRowAction:function(grid, record, action, row, col) {
            switch(action) {
                case 'icon-minus':
                    this.deleteRecord(record);
                break;
    
                case 'icon-edit-record':
                    this.recordForm.show(record, grid.getView().getCell(row, col));
                break;
            }
        } // eo onRowAction
        // }}}
        // {{{
        ,commitChanges:function() {
            var records = this.store.getModifiedRecords();
            if(!records.length) {
                return;
            }
            var data = [];
            Ext.each(records, function(r, i) {
                var o = r.getChanges();
                if(r.data.newRecord) {
                    o.newRecord = true;
                }
                o[this.idName] = r.get(this.idName);
                data.push(o);
            }, this);
            var o = {
                 url:this.url
                ,method:'post'
                ,callback:this.requestCallback
                ,scope:this
                ,params:{
                     cmd:'saveData'
                    ,objName:this.objName
                    ,data:Ext.encode(data)
                }
            };
            Ext.Ajax.request(o);
        } // eo function commitChanges
        // }}}
        // {{{
        ,requestCallback:function(options, success, response) {
            if(true !== success) {
                this.showError(response.responseText);
                return;
            }
            try {
                var o = Ext.decode(response.responseText);
            }
            catch(e) {
                this.showError(response.responseText, 'Cannot decode JSON object');
                return;
            }
            if(true !== o.success) {
                this.showError(o.error || 'Unknown error');
                return;
            }
    
            switch(options.params.cmd) {
                case 'saveData':
                    var records = this.store.getModifiedRecords();
                    Ext.each(records, function(r, i) {
                        if(o.insertIds && o.insertIds[i]) {
                            r.set(this.idName, o.insertIds[i]);
                            delete(r.data.newRecord);
                        }
                    });
                    this.store.each(function(r) {
                        r.commit();
                    });
                    this.store.modified = [];
    //                this.store.commitChanges();
                break;
    
                case 'deleteData':
                break;
            }
        } // eo function requestCallback
        // }}}
        // {{{
        ,showError:function(msg, title) {
            Ext.Msg.show({
                 title:title || 'Error'
                ,msg:Ext.util.Format.ellipsis(msg, 2000)
                ,icon:Ext.Msg.ERROR
                ,buttons:Ext.Msg.OK
                ,minWidth:1200 > String(msg).length ? 360 : 600
            });
        } // eo function showError
        // }}}
        // {{{
        ,deleteRecord:function(record) {
            Ext.Msg.show({
                 title:'Delete record?'
                //,msg:'Do you really want to delete <b>' + record.get('company') + '</b><br/>There is no undo.'
                ,msg:'Do you really want to delete <b>' + '</b><br/>There is no undo.'
                ,icon:Ext.Msg.QUESTION
                ,buttons:Ext.Msg.YESNO
                ,scope:this
                ,fn:function(response) {
                    if('yes' !== response) {
                        return;
                    }
    //                console.info('Deleting record');
                }
            });
        } // eo function deleteRecord
        // }}}
    
    }); // eo extend
            
        var siteDs = new Ext.data.XmlStore({
                    autoDestroy : true,
                    url : '/rest/sites/all',
                    record : 'Sites',
                    restful : true,
                    autoLoad : true,
                    fields : ['id', 'site', 'location', 'siteLocation']
                });
                
        var pstDs = new Ext.data.XmlStore({
              autoDestroy: true,
              url:'/rest/psts/all',
              record: 'Psts',
              restful:true,
              autoLoad: true,
              fields:['id','pst','pstName','pstNameDisplay']
          });
        
          var programDs = new Ext.data.XmlStore({
              autoDestroy: true,
              url:/rest/programs/all',
              record: 'programs',
              restful:true,
              autoLoad: true,
              fields:['id','program']
          });
    
    
    //register xtype
    Ext.reg('partinfo', Application.PartsInfo);

  7. #477
    Sencha - Community Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    27,538
    Vote Rating
    380
    jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future

      0  

    Default


    Check paths to icons in your css file(s), check value of Ext.BLANK_IMAGE_URL, check if you include all required css files and check Firebug Net tab if there is anything not found (red).
    Jozef Sakalos, aka Saki

    Education, extensions and services for developers at new http://extjs.eu
    News: Grid Search Plugin, ExtJS 5 Complex Data Binding using MVVM


  8. #478
    Sencha User
    Join Date
    Oct 2009
    Posts
    47
    Vote Rating
    1
    macdoug1 is on a distinguished road

      0  

    Question


    This is what is different in firebug - <div qtip="Delete Record" style="" class="ux-row-action-item icon-minus "/><div qtip="Edit Record" style="" class="ux-row-action-item icon-edit-record "/>

    when you use the html selection in firebug you see these div tags appear for your setup but when I do the same for mine I don't see them. I've checked the all the other items you mentioned as they were the first thing I looked at. Everything is loading except that the stuff above isn't getting created.

    Can you run mine and get it to work? It is just a replacement of your recordform.js.

  9. #479
    Sencha - Community Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    27,538
    Vote Rating
    380
    jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future

      0  

    Default


    Sorry, I do not have bandwidth to debug user's applications.

    Not created or zero dimensions? If not created, check the version of RowActions (always use devel version); if zero dimensions, look at styles and (still) paths.
    Jozef Sakalos, aka Saki

    Education, extensions and services for developers at new http://extjs.eu
    News: Grid Search Plugin, ExtJS 5 Complex Data Binding using MVVM


  10. #480
    Sencha User
    Join Date
    Oct 2009
    Posts
    47
    Vote Rating
    1
    macdoug1 is on a distinguished road

      0  

    Question Issues with how stores work for this recordform

    Issues with how stores work for this recordform


    I have finally got all the form components to work for the display and it will load data from a json request with the proxy. My issue now is - will this work with multiple stores for each grid column and then try to save this data to a url with a save method (which is needs to be a different store)? So what I have is three columns are drop downs and they are populated by a service that pulls json back to the store then I need another store that I can do a save using that method you created with a different url. Everytime I try to change the url in your commitChanges function I get issues with my other store not loading.

    I guess what I need is for this grid to load even when no data is available. But if I don't pass data into the proxy piece it doesn't load the complete grid and allow me to add rows to create my own data.

    Where is the proxy piece being loaded such that the grid won't render without it?
    Last edited by macdoug1; 7 Jan 2010 at 5:28 PM. Reason: Trying to better explain

Thread Participants: 97

  1. franklt69 (1 Post)
  2. Wolfgang (1 Post)
  3. mystix (1 Post)
  4. cobnet (8 Posts)
  5. chiphi13 (4 Posts)
  6. mike1993 (1 Post)
  7. violinista (1 Post)
  8. hui2008 (4 Posts)
  9. AlxH (12 Posts)
  10. oracio (1 Post)
  11. CINUE (2 Posts)
  12. phpcoder (3 Posts)
  13. ostghost (2 Posts)
  14. tdikarim (4 Posts)
  15. lkasdorf (3 Posts)
  16. derf (1 Post)
  17. mjlecomte (11 Posts)
  18. farracha (1 Post)
  19. jcwatson11 (2 Posts)
  20. robin30 (8 Posts)
  21. bluesapphire (1 Post)
  22. wm003 (1 Post)
  23. divxer (1 Post)
  24. escalade (2 Posts)
  25. boonkerz (5 Posts)
  26. JamesC (2 Posts)
  27. neenhouse (5 Posts)
  28. mask_hot (18 Posts)
  29. concep86 (2 Posts)
  30. sinma (2 Posts)
  31. kai5263499 (2 Posts)
  32. jcmartinez (1 Post)
  33. trak (1 Post)
  34. amit.shukld (1 Post)
  35. hsurya (1 Post)
  36. richgoldmd (1 Post)
  37. loic (7 Posts)
  38. jimpa911 (1 Post)
  39. chalu (3 Posts)
  40. damian79 (1 Post)
  41. jimkan (6 Posts)
  42. jahong (7 Posts)
  43. winnel (1 Post)
  44. joku (1 Post)
  45. josephf (2 Posts)
  46. indrajit_bin_rahwana (4 Posts)
  47. nojutsu (2 Posts)
  48. pokerking400 (15 Posts)
  49. georgiosleon (2 Posts)
  50. snilson (2 Posts)
  51. nightowl (1 Post)
  52. gthe (1 Post)
  53. descheret (1 Post)
  54. nebbian (2 Posts)
  55. se7en.hu (1 Post)
  56. towanime (2 Posts)
  57. pravidya (4 Posts)
  58. cnagel (2 Posts)
  59. extnam01 (2 Posts)
  60. Rothariger (6 Posts)
  61. dsmaevich (1 Post)
  62. uidtest (2 Posts)
  63. savant (4 Posts)
  64. aserron (1 Post)
  65. skaue (1 Post)
  66. ielektronick (1 Post)
  67. kalpan (4 Posts)
  68. jasonb885 (2 Posts)
  69. wemerson.januario (1 Post)
  70. extjs_new (23 Posts)
  71. Dumas (24 Posts)
  72. m.natarajan (1 Post)
  73. MrEnirO (4 Posts)
  74. jove76 (2 Posts)
  75. CircleCode (3 Posts)
  76. mdimino (7 Posts)
  77. flinz (2 Posts)
  78. vince (2 Posts)
  79. jmaldini (5 Posts)
  80. mixer80 (1 Post)
  81. prox00 (1 Post)
  82. macdoug1 (14 Posts)
  83. return1.at (8 Posts)
  84. islabucasgrande (1 Post)
  85. big (1 Post)
  86. NicP (9 Posts)
  87. taron133 (1 Post)
  88. araiczyk (1 Post)
  89. adhoul (1 Post)
  90. mayurid (9 Posts)
  91. Kalpit (10 Posts)
  92. bizcatalyst (1 Post)
  93. Manuelbond007 (2 Posts)
  94. nasargus (1 Post)
  95. shahab_et (1 Post)
  96. stevwinata (5 Posts)
  97. tomdchi (2 Posts)