1. #121
    Sencha User Stormseeker's Avatar
    Join Date
    Jan 2010
    Location
    Evanston, Illinois
    Posts
    55
    Vote Rating
    1
    Stormseeker is on a distinguished road

      0  

    Default Component.js -> getRefItems question.

    Component.js -> getRefItems question.


    I have eclipse setup to run all code in my project through JSHint and I noticed a warning about this below code (Expected a conditional expression and instead saw an assignment) and was trying to figure out the meaning.

    Code:
                if (item = Ext.getCmp(ids[index])) {
                    items.push(item);
    
    
                    if (deep && item.getRefItems) {
                        items.push.apply(items, item.getRefItems(true));
                    }
                }
    For the first if statement, are you just trying to check if the item object exists after you try and retrieve it from Ext.getCmp... I.E. would it be equal to this?

    Code:
    item = Ext.getCmp(ids[index]);
    if (item)
    {
        items.push(item);
        if (deep && item.getRefItems)
        {
            items.push.apply(items, item.getRefItems(true));
        }
    }

  2. #122
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,585
    Vote Rating
    322
    skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future

      0  

    Default


    Yes.

  3. #123
    Sencha User
    Join Date
    Jun 2013
    Posts
    2
    Vote Rating
    0
    extjsnewbie81 is on a distinguished road

      0  

    Default ComponentQuery to get the reference of 'ComponentColumn' child elements

    ComponentQuery to get the reference of 'ComponentColumn' child elements


    Hi Skirtle,

    I am new to ExtJS.

    I am having some problem with getting reference of ComponentColumn child elements in the MVC controller.

    I am using below line of code.
    Code:
    var columns = mygrid.getView().getHeaderCt().getGridColumns();
    var directChildElements = Ext.ComponentQuery.query('columns[2] > *');
    Here I am getting empty array as the value of 'directChildElements'.

    Please let me know if I am doing something wrong.

    Thanks

  4. #124
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,585
    Vote Rating
    322
    skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future

      0  

    Default


    That second line has no chance of working. The query method is being passed a string that contains the name of a local variable but how could it possibly resolve that name to the array?

    Something like this should work:

    Code:
    var directChildElements = columns[2].query('> *');

  5. #125
    Sencha User
    Join Date
    Jun 2013
    Posts
    2
    Vote Rating
    0
    extjsnewbie81 is on a distinguished road

      0  

    Default


    Thanks Skirtle its working for me now.

  6. #126
    Sencha User
    Join Date
    Mar 2011
    Location
    Germany
    Posts
    118
    Vote Rating
    0
    da_b0uncer is an unknown quantity at this point

      0  

    Default


    For resizing purposes I extended the component column with this:

    Code:
       initComponent: function() {
          this.callParent( arguments );
          this.on( 'resize', function( column ) { column.up( 'grid' ).view.refresh(); } );
       }
    Seems a bit slow, because it's refreshing the whole grid, not only the component column.

    Is there a better way?

  7. #127
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,585
    Vote Rating
    322
    skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future

      0  

    Default


    I don't understand what you're trying to do. Components should automatically be resized when the column is resized.

  8. #128
    Sencha User
    Join Date
    Mar 2011
    Location
    Germany
    Posts
    118
    Vote Rating
    0
    da_b0uncer is an unknown quantity at this point

      0  

    Default


    I see, so this is just a problem with draw components (which I'm using to generate column charts), I guess.

  9. #129
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,585
    Vote Rating
    322
    skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future

      0  

    Default


    Take a look at the method setChildWidth. If you're having problems with the children resizing then that's probably the best place to start debugging. Ultimately it relies on the setWidth method of the child component.

    If you're going to refresh the whole view then I'd recommend overriding onColumnResize rather than initComponent. Currently that method just forces a resize on all the children but if you're going to be re-creating them all anyway then that's just a waste of time.

  10. #130
    Sencha User
    Join Date
    Mar 2011
    Location
    Germany
    Posts
    118
    Vote Rating
    0
    da_b0uncer is an unknown quantity at this point

      0  

    Default


    I create the draw component in the renderer function, so my first thought was this:

    Code:
    this.on('resize',function(column){
      column.render();
    });
    But it only threw errors.

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi