1. #11
    Ext User
    Join Date
    Sep 2007
    Posts
    102
    Vote Rating
    0
    timo.nuros is on a distinguished road

      0  

    Default


    My extension doesn't support xmlReader. You have to add it to my extension code.

    Regards,
    Timo

  2. #12
    Ext User
    Join Date
    Mar 2008
    Posts
    24
    Vote Rating
    0
    vk214 is on a distinguished road

      0  

    Default


    Hi Timo,
    Thanks...I know you had mentioned earlier that you didn't support xml. Can you give me some guidance on where you use the 'reader' parameter in your function call? I see you passing it to the super class, but I'm not sure how it's actually being used. I'd like to add to it, but am hoping for a bit of direction on where to look to do so...

  3. #13
    Ext User
    Join Date
    Sep 2007
    Posts
    102
    Vote Rating
    0
    timo.nuros is on a distinguished road

      0  

    Default


    Look for the switch statement. You have to figure out the rest on your own. Sorry can't give more free support on that.

    cheers,
    Timo

  4. #14
    Ext User
    Join Date
    Mar 2008
    Posts
    24
    Vote Rating
    0
    vk214 is on a distinguished road

      0  

    Default


    I must be looking at the wrong code, because there is no "switch" statement that I can see.

    I'm sorry you got the wrong idea - I'm not trying to get 'free support'. Rather I post these questions b/c I thought this was an online community that could help me get up to speed with this new library. The questions I ask may seem trivial to you, but being completely new to Ext (just saw it a couple weeks ago), I'm still trying to wrap my hands around some topics. I was trying to create a POC for my boss to convince him to use this *very cool* library rather than another library he is looking at, which does all of these things out of the box.

    Thanks anyway for your help.

  5. #15
    Ext User
    Join Date
    Sep 2007
    Posts
    102
    Vote Rating
    0
    timo.nuros is on a distinguished road

      0  

    Default


    I see a switch statement. I posted only 2 pieces of code, one example, one plugin code. It's not hard to find it when you copy the code to a text editor and search for "switch". Maybe I didn't make it clear:

    This extension is by me and I am NOT from the Ext team. Thus, I cannot give you free support. I work for customers, thus everytime I do anything in this forum is business related. You requested to extend my code (which doesn't belong to Ext itself) with something it doesn't do, so you have to take your time and learn JS, Ext and the internals and follow my hints (which you definitely ignored, because it is not too hard to find the switch statement) or pay me to implement it.

    cheers,
    Timo

  6. #16
    Ext User
    Join Date
    Mar 2008
    Posts
    24
    Vote Rating
    0
    vk214 is on a distinguished road

      0  

    Default


    I understand that you are not part of the core Ext team, and I do appreciate that you put out an extension for the community to see. To clarify, I was never asking you to implement this for me, I am willing to learn on my own, I had only asked for some guidance from you. I don't appreciate your presumption otherwise.
    Your code that I had gotten from this post was different when I copied it. I'm not sure if you've changed the code recently or if I somehow copied/pasted wrong, but I did not get the "createSubData" method.

    This is the code I saw:
    Code:
    //Extension for Expander
    Ext.grid.SubTableRowExpander = function(config){
    	if (!config.subdata) { config.subdata = 'subdata'; }
        Ext.apply(this, config);
    
        Ext.grid.SubTableRowExpander.superclass.constructor.call(this);
    
        this.state = {};
        this.bodyContent = {};
    	
    };
    
    Ext.extend(Ext.grid.SubTableRowExpander, Ext.grid.RowExpander, {
    	enableCaching: false,
    	
    	init: function (grid) {
    	
    	    var ret = Ext.grid.SubTableRowExpander.superclass.init.call(this, grid);
    		
    		this.grid.view.afterMethod('onColumnHiddenUpdated', this.reconfigureTemplate, this);
    		this.grid.view.afterMethod('onLayout', this.reconfigureTemplate, this);
    		this.grid.view.afterMethod('onColumnWidthUpdated', this.doWidth, this);
    		this.grid.view.afterMethod('onAllColumnWidthsUpdated', this.doAllWidths, this);
    		this.grid.view.afterMethod('afterMove', this.doAllWidths, this);
    		
    		
    	},
    	doWidth: function () {
    		this.reconfigureTemplate();
    		this.updateRows();
    	},
    	updateRow: function (row) {
    		var record = this.grid.store.getAt(row);
    		
    	    if(typeof row == 'number'){
    	        row = this.grid.view.getRow(row);
    	    }
    	    
    	    var body = Ext.DomQuery.selectNode('tr:nth(2) div.x-grid3-row-body', row);
    		
    		var records = this.grid.store.reader.readRecords(record.data[this.subdata]);
    		
    		records = this.processRenderMethod(records);
    
    		var content = this.tpl.apply(records.records);
    		
    		this.bodyContent[record.id] = content;
    	   	body.innerHTML = content;
    	},
    	updateRows: function () {
          	var ns = this.grid.view.getRows();
            for(var i = 0, len = ns.length; i < len; i++){
    			this.updateRow(i);
    		}
    	},
    	doAllWidths: function () {
    		this.reconfigureTemplate();
    		this.updateRows();
    	},	
    	getActivatedGridColumns: function () {
    		var cm = this.grid.view.cm;
    		
    		var cols = [];
    		
    		for(var i = 0; i < cm.getColumnCount(); i++){
    			if (!cm.isHidden(i)) {
    				var col = {};
    				var name = cm.getDataIndex(i);
    				col.name = (typeof name == 'undefined' ? this.ds.fields.get(i).name : name);
    				col.index = i;
    				col.width = this.getColumnWidth(i);
    				col.renderer = cm.getRenderer(i);
    				cols.push(col);
    			}
    		}
    		
    		return cols;
    	},
    	getColumnWidth : function(col){
            var w = this.grid.view.cm.getColumnWidth(col);
            if(typeof w == 'number'){
                w = (Ext.isBorderBox ? w : (w-this.grid.view.borderWidth > 0 ? w-this.grid.view.borderWidth:0));
            }
    		
            return w;
        },
    		
    	reconfigureTemplate: function () {
    		var cols = this.getActivatedGridColumns();
    
    		var template = [
    							'<table cellspacing="0" cellpadding="0" class="x-grid3-row-table">',
    							'<tpl for=".">'
    						];
    
    		template.push('<tr class="x-grid3-row-alt">');
    		
    		var padding, colWidth;
    		
    		for(var i = 1; i < cols.length; i++){
    			if (i == 1) {
    				padding = 'padding-left: 10px;';
    			} else {
    				padding = '';
    			}
    		
    			colWidth = cols[i].width;
    			
    			template.push('<td class="x-grid3-col x-grid3-cell x-grid3-td-'+cols[i].name+'" style="width: '+colWidth+'px;"><div style="'+padding+'" class="x-grid3-cell-inner x-grid3-col-'+cols[i].name+'">' + '{values.data.' + cols[i].name + '}</div></td>');
    			
    		}
    		
    		template.push('</tr>');
    		template.push('</tpl>');
    		template.push('</table>');
    		
    		
    		this.tpl = new Ext.XTemplate(template);
    					
    	    if(this.tpl){
    	        if(typeof this.tpl == 'string'){
    	            this.tpl = new Ext.Template(this.tpl);
    	        }
    	        this.tpl.compile();
    	    }
    				
    		return;
    		
    	},
    	processRenderMethod: function (records) {
    		var cols = this.getActivatedGridColumns();
    		
    		for (var i=0;i<records.records.length;i++) {
    			for(var j = 1; j< cols.length; j++){
    				records.records[i].data[cols[j].name] = cols[j].renderer(records.records[i].data[cols[j].name]);
    			}
    		}
    		
    		return records;
    	},
        getBodyContent : function(record, index){
    		var records = this.grid.store.reader.readRecords(record.data[this.subdata]);
    		
    		records = this.processRenderMethod(records);
    		
    		body = this.tpl.apply(records.records);
    		this.bodyContent[record.id] = body;
    		return body;
        }
    });
    As you can see, there is no switch statement, and there really isn't a place in this code where you specify the reader as "array" or "json". That's why I was having a tough time and asked for your guidance.

  7. #17
    Ext User
    Join Date
    Sep 2007
    Posts
    102
    Vote Rating
    0
    timo.nuros is on a distinguished road

      0  

    Default


    Thats strange, because I posted the updated example and code at the same time (because at the time I introduced the "reader" property in the sample, I already had done that in the plugin code. Probably there went something wrong when you copied it. Could you implement the XmlReader? As I said, I never used it before, and thus I have no clue if it is compatible with my Plugin at all.

    By the way, if this plugin is an absolute requirement for your evaluation, you better stick to the other product you mentioned since this is not a base component of Ext - which also means that if there will be a Version 3 of Ext, it is unlikely that I port this thing to the next version (but I plan to maintain it for my customer for the 2.x cycle).

    cheers,
    Timo

  8. #18
    Sencha User
    Join Date
    Aug 2007
    Posts
    64
    Vote Rating
    0
    jelt is on a distinguished road

      0  

    Arrow


    Hi all,

    Thank you timo for your shared code, it's geat

    To hide the expander (+) when there is no subdata, patch the plugin like this :

    line 196, replace :
    Code:
    renderer : function(v, p, record){
      p.cellAttr = 'rowspan="2"';
      return '<div class="x-grid3-row-expander"> </div>';
        },
    With :
    Code:
      renderer : function(v, p, record){
        p.cellAttr = 'rowspan="2"';
        if ((record.subdata) && (record.subdata.totalRecords) && (record.subdata.totalRecords>0)) {
          return '<div class="x-grid3-row-expander"> </div>';
        } else {
          return '';
        }
      },
    Feel free to add a config parameter to choose if you want to display useless expander or not

    Oh, and i just found a little bug (FF2 & IE6).
    In normal use of the plugin subline is not highlightable, OK
    But after you clicked one time on a sub-cell, if you put the mouse over the CELL you have previously clicked, sub line is highlighted !!
    This strange behavious occurs only on the clicked cells of the sub lines.


    Edit : I just found why ! The inner DIV you used have no ID. When you click on a cell, ext generate id for the div, then the sub line become highlightable.

    Edit 2 : previous code written have issue if no one subdata is given for the grid (of for the current page of a paging)

  9. #19
    Ext User
    Join Date
    Dec 2007
    Posts
    2
    Vote Rating
    0
    BrunoG is on a distinguished road

      0  

    Default


    Use the following 'renderer' function of Ext.ux.SubTableRowExpander:
    Code:
        renderer : function(v, p, record){
           	p.cellAttr = 'rowspan="2"';
            if(record.data.subdata.length > 0) {
              return '<div class="x-grid3-row-expander"> </div>';
            } else {
              return '';
            }

  10. #20
    Sencha User
    Join Date
    Aug 2007
    Posts
    64
    Vote Rating
    0
    jelt is on a distinguished road

      0  

    Default fix for "over" bug

    fix for "over" bug


    Hi,

    To fix the pervious bug i reported (sub line not highlighted), just apply this :

    find (line 36x):
    Code:
    template.push('<td class="x-grid3-col x-grid3-cell x-grid3-td-'+cols[i].name+'" style="width: '+colWidth+'px;"><div style="'+padding+'" unselectable="on" class="x-grid3-cell-subtablerow x-grid3-cell-inner x-grid3-col-'+cols[i].name+'">' + '{values.data.' + cols[i].name + '}</div></td>');
    and replace by :
    Code:
    template.push('<td class="x-grid3-col x-grid3-cell x-grid3-td-'+cols[i].name+'" style="width: '+colWidth+'px;"><div style="'+padding+'" unselectable="on" id="subfield-{values.id}-'+cols[i].name+'" class="x-grid3-cell-subtablerow x-grid3-cell-inner x-grid3-col-'+cols[i].name+'">' + '{values.data.' + cols[i].name + '}</div></td>');

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