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

      0  

    Default Action Item rendering with serverside data

    Action Item rendering with serverside data


    Hi!

    I want to create a grid where a edit action item is displayed, if the user has sufficient rights (entry based)

    What would be a performant architecture for that?

    I thought about creating a AuthorizationsStore, where I keep the rights and then have following action item function:
    PHP Code:
    getClass: function(id,metadata,record,rowIndex,colIndex,store){
        
    // keep a reference for next execution
        
    this.authorizationsStore Ext.StoreMgr.get('Authorzations');

        
    // get the authorization from the model
        
    var allowed this.authorizationsStore.isAllowed('edit',id);

        
    // delay rendering
        
    if(allowed===-1) {
            
    // authorization now yet loaded
            
    if(!this.loadingAuthorizations) {
                
    this.loadingAuthorizations true;

                
    // re-render when available
                
    this.authorizationsStore.on('loaded', {
                    
    singletrue,
                    
    callback: function() {
                        
    // re-render columns
                        
    this.doLayout(); // (is this working)

                        // change flag
                        
    this.loadingAuthorizations false;
                    }
                }); 
    //eo on

                
    return 'loading-icon';
            }
        }

        
    // already loaded, return correct icon
        
    return allowed 'edit-icon' 'x-hide-display';


    Do you have tips for a better pattern?


    thanks
    Roland

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    8,927
    Vote Rating
    443
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    I am not sure I would check authorization level on each render call, that could be very expensive. I would suggestdrawing the icons and using the handler to allow/deny access at time of click.

    Regards,
    Scott.

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

      0  

    Default


    Hello!

    Yeah, I figured out the same, now I'm checking on icon-click...

    thanks
    Roland

Thread Participants: 1

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