Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

  1. #1
    Sencha User
    Join Date
    Jan 2010
    Posts
    168
    Vote Rating
    0
    Tumac is on a distinguished road

      0  

    Default Placement of variable for use in combobox url

    Placement of variable for use in combobox url


    I have a button associated with my grid, that when i press for "NEW LINE" it opens up a new window with an input form (below).

    I am passing the keyfield to the pop-up form as a hidden field.

    On the form, I have a combobox that I would like to pass the keyfield to the store so the store only returns records associated with that keyfield in the dropdown.

    I have tried placing this var can=Ext.getCmp('container').getValue(); in many places and get the consistent result

    Ext.getCmp('container').getValue() is undefined

    I assume this is because it is trying to retrieve this value before the pop-form is rendered. Should it be a listener on the combo that onClick gets the value?

    Code:
    Ext.ns("STScls.form");
    
    STScls.form.TallyDetailForm = Ext.extend(STScls.form.FormPanelBaseCls, {
        border        : true,
        autoScroll    : true,
        bodyStyle     : 'background-color: #E8EDEA; padding: 10px',
        layout        : 'form',
        defaultType   : 'textfield',
    
        initComponent : function(container) {
            Ext.applyIf(this, {
                items : [
                     this.buildFormFields()
                ]
            });
    
            STScls.form.TallyDetailForm.superclass.initComponent.call(this);
    
            this.addEvents({
                savedetail   : true
            });
    
            if (this.record) {
                this.on({
                    scope  : this,
                    render : {
                        single : true,
                        fn     : this.loadFormAfterRender
                    }
                });
            }
        },
    
        buildFormFields : function(container) {
            var tallyContainer = this.buildTallyContainer(can);
    
            return [
                {
                     xtype : 'hidden'
                    ,name  : 'tallyID'
                },{
                     xtype : 'hidden'
                    ,name  : 'container'
                    ,id    : 'container'  <-- KEYFIELD If I make unhidden, my value is there
                    ,itemId: 'container'
                },
                    tallyContainer
            ];
            var can=Ext.getCmp('container').getValue();  <--UNDEFINED
            //var can=Ext.get('container').getValue();
        }
        
        ,buildTallyContainer : function(can) {
            console.log(can);
            return {
                 xtype       : 'container'
                ,layout      : 'column'
                ,defaultType : 'container'
                ,anchor      : '-10'
                ,defaults    : {
                     layout         : 'form'
                    ,labelAlign     : 'top'
                    ,anchor         : '-10'
                    ,layoutConfig   :{
                         labelStyle     : 'font-weight:bold;text-align:center;border:1px solid navy;'
                        ,labelSeparator : ''
                    }
                }
                ,items  : [
                    {
                         width: 110
                        ,items: {
                             xtype: 'combo'
                            ,fieldLabel: 'PO #'
                            ,name: 'comboPO'
                            ,displayField:'poID'
                            ,allowBlank: false
                            ,valuefield: 'poID'
                            ,hiddenName: 'poID'
                            ,triggerAction:'all'
                            ,width: 109
                            ,store: {
                                 xtype: 'jsonstore'
                                ,url: '?c=lookup&m=canPOList&can='+can <----  THIS IS THE VARIABLE
                                ,autoLoad: false
                                ,root: 'data'
                                ,fields: ['container','poID','crates','transitStatus']
                            }
                        }
                    },{

  2. #2
    jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    Frederick MD, NYC, DC
    Posts
    16,353
    Vote Rating
    77
    jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all

      0  

    Default


    1) Do not use Ext.getCmp inside of your classes.
    2) Why would you want to get the value before you've set it?!!?
    3) The instance of Ext.form.HiddenField has not been created yet.
    4) See below image:

  3. #3
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,496
    Vote Rating
    44
    Animal has a spectacular aura about Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    @OP See the ref config

  4. #4
    jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    Frederick MD, NYC, DC
    Posts
    16,353
    Vote Rating
    77
    jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all

      0  

    Default


    ref won't help him because of the order in which he's trying to use it.


  5. #5
    Sencha User
    Join Date
    Jan 2010
    Posts
    168
    Vote Rating
    0
    Tumac is on a distinguished road

      0  

    Default


    So my presumption is correct, you validated that. So it goes to my question, where/how should i pick up the value once the form is rendered to pass it to my combo? This is based on your code from the book (yes I purchased).

    It is like I associate employee with dept in an earlier process. In the new cardpanel, I click on the department list and get dept info loaded into the form. the detail grid on the form contains data about employees that are already part of the department. So I click NEW and have it pass the dept ID into the hidden container, the EmployeeEditorWindow form has a combobox with THAT dept's employees.

    Does that make sense?

    In my case:

    I populate the form from a master grid on the West. I then click "NEW" on the detail grid (which opens a new form for data input) and pass the container(keyfield) to the hidden. On an earlier process I have already associated poID's with containers.

    Now I want to add Item detail to the DB, so when I click NEW, I want only those PO's that are associated with the "container" to be listed in the combobox.

  6. #6
    Sencha User
    Join Date
    Jan 2010
    Posts
    168
    Vote Rating
    0
    Tumac is on a distinguished road

      0  

    Default Reference

    Reference


    I may have some bad references still hanging around because I have tried to pass it several ways. I use this function to pass the keyfield data into the EditorForm (from the "Manager")

    This populates the hidden "container" field on the form.

    Code:
    ,onFormNewDetail : function(transitForm) {
            var container = transitForm.getValues().container;
            new STS.TallyEditorWindow({
                 container: container
                ,listeners    : {
                    detailsaved : {
                        single : true,
                        scope  : this,
                        fn     : this.detailSaveSuccess
                    }
                }
            }).show();
        }

  7. #7
    Sencha User
    Join Date
    Jan 2010
    Posts
    168
    Vote Rating
    0
    Tumac is on a distinguished road

      0  

    Default SOLVED: Thanks for not calling me out

    SOLVED: Thanks for not calling me out


    From the class that loads the form, I pass the container, then simply use the variable....was making it too complicated before.....

    first call to build form:
    Code:
     buildDetailForm : function() {
             
            return {
                 xtype  : 'tallydetailform'
                ,border : false
                ,itemId : 'tallydetailForm'
                ,record : this.record
                ,container: this.container
                ,tbar   : null
            };
        },
    Then in form

    Code:
    ,items: {
                             xtype: 'combo'
                            ,fieldLabel: 'PO #'
                            ,name: 'comboPO'
                            ,displayField:'poID'
                            ,allowBlank: false
                            ,valuefield: 'poID'
                            ,hiddenName: 'poID'
                            ,triggerAction:'all'
                            ,width: 109
                            ,store: {
                                 xtype: 'jsonstore'
                                ,url: '?c=lookup&m=canPOList&can='+this.container
                                ,autoLoad: false
                                ,fields: ['poID']
                            }
                        }

Similar Threads

  1. Variable Placement? Controlling Memory Usage.
    By cluettr in forum Ext 1.x: Help & Discussion
    Replies: 11
    Last Post: 3 Dec 2009, 9:11 PM
  2. [Solved] store url variable for virtual site
    By mohaaron in forum Ext 3.x: Help & Discussion
    Replies: 1
    Last Post: 18 Jun 2009, 11:11 AM
  3. Replies: 5
    Last Post: 31 Jan 2008, 2:30 PM
  4. How to variable sending by url tab2 from a html form
    By operador in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 30 Jan 2008, 11:28 AM
  5. Replies: 0
    Last Post: 30 Jan 2008, 9:00 AM

Thread Participants: 2