1. #501
    Sencha - Community Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    27,133
    Vote Rating
    322
    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


    Well, one thing is example and another extension/plugin itself - I think RecordForm doesn't need anything else.

  2. #502
    Sencha User Dumas's Avatar
    Join Date
    Dec 2008
    Location
    Vienna, Austria
    Posts
    564
    Vote Rating
    8
    Dumas is on a distinguished road

      0  

    Default


    On line 99 you use the IconMenu.

    regards
    Roland

  3. #503
    Ext User
    Join Date
    Jan 2010
    Posts
    15
    Vote Rating
    0
    NicP is on a distinguished road

      0  

    Default


    I have come up with a solution for the custom form layout option that I require to replace the standard form that is generated for the plugin, I am having one last problem however... I define a custom form layout as a variable and then I include two more parameters when creating a new recordForm: customFormPanel and formName (name of variable)

    Code:
    this.recordForm = new Ext.ux.grid.RecordForm({
    			 title:'Customers Form'
    			,iconCls:'icon-edit-record'
    			,columnCount:1
    			,customFormPanel:true
    			,formName:'customerForm'
    			,customPanelLayout:'nameAndCompany, internet, phones, busAddress, homeAddress'
    			,ignoreFields:{customerID:true}
    Then in the ux I include some code to tell which layout to use:

    Code:
    ,items:[this.formName]
    I get an error in the ext-all-debug:
    comp is undefined [Break on this error] }else if(!comp.events){

    But if I just use the actual var name in place of this.formName, i.e. customerForm, it works fine.

    any ideas??
    Last edited by mystix; 8 Mar 2010 at 6:48 AM. Reason: POST CODE IN [code][/code] TAGS. see http://extjs.com/forum/misc.php?do=bbcode#code

  4. #504
    Sencha - Community Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    27,133
    Vote Rating
    322
    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


    Then this.formName doesn't contain the expected value. A scope problem?

  5. #505
    Ext User
    Join Date
    Jan 2010
    Posts
    15
    Vote Rating
    0
    NicP is on a distinguished road

      0  

    Default


    but if I alert(this.formName) then I get the expected result. Could it be that there are single or double quotes surrounding the value? I don't see any so that is why I'm a bit confused.

  6. #506
    Sencha - Community Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    27,133
    Vote Rating
    322
    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


    You don't use Firebug? alert(this.formName) should output only [Object] object, if this.formName is an object. I any case, install Firebug (or start to use it), inspect the values of crucial variables - some of them is not what it should be.

  7. #507
    Sencha User Dumas's Avatar
    Join Date
    Dec 2008
    Location
    Vienna, Austria
    Posts
    564
    Vote Rating
    8
    Dumas is on a distinguished road

      0  

    Default extending recordForm with a proper create function

    extending recordForm with a proper create function


    Hi!

    In your example also use the recordForm to create new records, which makes sense. But I had some issues:
    - I want a different title for creates
    - It's kind of ugly when I click on "add record" that there is already a line created which then has to be deleted onCancel again. But the most important thing, it totally breakes when you want to use Ext.Direct with autoSave

    Therefore I added some more, optional public configs (and a private config):
    PHP Code:
        /**
         * @cfg {String} recordPrototype the default data to start with for a new record
         */

        /**
         * @cfg {String} createTitle Title to use for popup window when creating new records
         */
        // {{{
        /**
         * Override this to add processing you need to run after the record create
         * @param {Ext.data.Record} record Record that has been updated
         */
        
    ,afterCreateRecord:Ext.emptyFn
        
    // }}}
        /**
         * @cfg {String} action create or update depending on the current action to perfom onOk
         * @private
         */
        // will be defined on first this.show() 
    so that it works I had to add following new method:
    PHP Code:
        /**
         * Create record in store
         * @private
         */
        
    ,createRecord:function() {
            var 
    store this.store,
                
    record this.record;
            
            
    // loop through form fields and update underlying record
            
    this.form.getForm().items.each(function(itemi) {
                
    record.set(item.nameitem.getValue());
            }, 
    this);
            
            
    store.addSorted(record);
            
            
    this.afterCreateRecord(record);

        } 
    // eo function createRecord
        // }}} 
    Inside onOk I have changed: this.updateRecord();
    to: this[this.action+'Record']();

    and here's the new show method and an convinience method create()
    PHP Code:
        // {{{
        /**
         * Shows the record form in the window
         * *modified for my needs by Roland Schütz*
         * @param {Ext.data.Record} record Record to bind to
         * @param {Ext.Element/DOMElement/String} animEl window show animation element
         */
        
    ,show:function(recordanimElaction) {

            
    // if no action was defined it is 'update' to don't break old code
            
    action action || 'update';

            
    // if the new show is a create....
            
    if(action==='create') {
                
    // create a new record
                
    record = new this.store.recordType(this.recordPrototype || {});
                
    // fill the record with defaults
                
    record.fields.each(function(f) {
                    
    // if there was nothing set in the prototype, set it to the default or null
                    
    record.data[f.name] = record.data[f.name] || f.defaultValue || null;
                });
                
    record.commit();
            }

            
    // lazy create window
            
    if(!this.window) {
                
    this.window this.getPanel();
            } else {
                
    // center it, because the user can have scrolled
                
    this.window.center();
            }


            
    // show window
            
    this.window.show(animEl);

            
    // if the action has changed set the new title
            
    if(action!==this.action) {
                
    // only use the create title if defined
                
    if(action!=='create' || this.createTitle) {
                    
    this.window.setTitle((this.action==='create') ? this.createTitle this.title);
                }
                 
    // current action is now var action
                
    this.action action;
            }

            
    // populate fields with values or null all
            
    var basicForm this.form.getForm();
            
    basicForm.loadRecord(record);

            
    // save record we're currently editing
            
    this.record record;
        } 
    // eo function show
        // }}}
        // {{{
        /**
         * Shows the record form in the window to create a new record
        * If you want to use this define the store property in the config
         * @param {Ext.Element/DOMElement/String} animEl window show animation element
         */
        
    ,create:function(animEl) {
            
    this.show(nullanimEl'create');
        }
        
    // }}} 
    This code won't break any old code, but enables new functionality for new code.
    If you like the idea feel free to use all/parts of the code. I put it all under ehm.... LGPL 3.0 license.


    I also added the script for easy compare for you and easy use of this branch for other devs. This recordForm works perfectly with Ext.Direct and autoSave.

    Best Regards,
    Roland

    Edit: Minor update of the Script to mod Version 1.0.1
    Attached Files

  8. #508

    Default


    That's fantastic! Thanks for sharing.

  9. #509
    Sencha User Dumas's Avatar
    Join Date
    Dec 2008
    Location
    Vienna, Austria
    Posts
    564
    Vote Rating
    8
    Dumas is on a distinguished road

      0  

    Default


    You're wellcome ;-)

    PS: I just did a minor update, you might wanna update...

  10. #510
    Ext User
    Join Date
    May 2010
    Posts
    17
    Vote Rating
    0
    adhoul is on a distinguished road

      0  

    Default


    Hello, great job,

    I've tried Saki's example, but I can't find the Icons you use in your buttons (you know, the ones for "Add Records" etc).. are these available somewhere? thank you

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)

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar