1. #1
    Ext User
    Join Date
    Apr 2007
    Posts
    189
    Vote Rating
    0
    captainm1uk is on a distinguished road

      0  

    Default View icons & twistie icons - update

    View icons & twistie icons - update


    If i use view icons in a view and i catagorize them, the icons do not show - is there a way round this ?

    Also how can i change the twistie icons

    Thanks
    Last edited by captainm1uk; 15 Oct 2007 at 11:53 AM. Reason: Additional info

  2. #2
    Ext User
    Join Date
    Apr 2007
    Location
    Melbourne, Australia
    Posts
    169
    Vote Rating
    0
    Zakaroonikov is on a distinguished road

      0  

    Default


    Quote Originally Posted by captainm1uk View Post
    If i use view icons in a view and i catagorize them, the icons do not show - is there a way round this ?

    Also how can i change the twistie icons

    Thanks
    Are you using GavinL's extension to ext.nd for categorised views? If so I did the following to get +/- instead of the standard twisties:

    Code:
    dominoRenderer: function(val, cell, row, rowIdx, colIdx, ds) {
    ...
    		 		output += (row.node.getAttribute("children")) ?
    					"<img id='" + Ext.id() + "' class='ext-nd-ed-twistie' src='" + extPath + "/ext/resources/images/default/tree/elbow-plus-nl.gif' />" :
    					"<img class='ext-nd-ed-blank' ssrc='" + extPath + "/ext/resources/images/default/tree/elbow-plus-nl.gif' />";
    ...
    Where extPath = the location of your ext libraries

    and I replaced expand/collapse string replacements with plus/minus in (ie expand -> plus, collapse -> minus) retrieveChildNodes

    Code:
    	retrieveChildNodes : function(row, elementId, unid, position, children) {
    
    		var oTwistie = Ext.getDom(elementId);
    		var view = this.grid.getView();
    		var selModel = this.grid.selModel;
    		var rowIdx = this.ds.indexOf(row);
    		var parentRowId = row.id;
    		var currentRowId = null;
    		var q = Ext.DomQuery;
    		var tr = null;
    
    		if (oTwistie) {
    			var bIsCollapsed = (oTwistie.src.indexOf("plus") >= 0) ? true : false;
    			if (bIsCollapsed) {
    				oTwistie.src = oTwistie.src.replace(/plus/g, "minus");
    
    				if (!row.childRowsLoaded) {
    					var childNodeData = new Ext.data.Connection();
    
    					var sRestrictUrl =  (this.showSingleCategory) ? "&RestrictToCategory=" + this.showSingleCategory : "";
    					var gridEl = this.grid.getGridEl();
    					gridEl.mask('Loading...','x-mask-loading');
    
    					childNodeData.request({
    						url: this.dbPath + this.viewName + "?ReadViewEntries&Start=" + position + ".1&Count=" + children + "&Collapse=" + position + sRestrictUrl + "&nocache=" + encodeURIComponent(new Date()),
    						method: "GET",
    						callback: this.renderChildNodeData,
    						scope: this
    					});
    				} else {
    					//Display existing child rows
    					this.grid.selModel.selectNext();
    					row = selModel.getSelected();
    					while(row) {
    						currentRowId = row.id;
    
    						//Ensure we only act on child rows
    						if(this.getNodeDepth(currentRowId) <= this.getNodeDepth(parentRowId)) { break; }
    
    						//Make sure we only act on immediate descendants
    						if(this.getNodeDepth(currentRowId) == parseInt(this.getNodeDepth(parentRowId) + 1)) {
    							tr = view.getRow(this.ds.indexOf(row));
    							if (tr) {
    
    								tr.style.display = "";
    
    								//Now find the twistie, and reset its state to collapsed
    								oTwistie = q.selectNode("IMG[class='ext-nd-ed-twistie']", tr);
    								if (oTwistie) {
    									oTwistie.src = oTwistie.src.replace(/minus/g, "plus");
    								}
    							}
    						}
    
    						selModel.selectNext();
    						row = selModel.getSelected();
    						if (row.id == currentRowId) { row = null };
    					}
    
    					selModel.selectRow(rowIdx, false);
    				}
    
    			} else {
    				oTwistie.src = oTwistie.src.replace(/minus/g, "plus");
    
    				//Hide child rows
    				this.grid.selModel.selectNext();
    				row = selModel.getSelected();
    				while(row) {
    					currentRowId = row.id;
    
    					if(this.getNodeDepth(currentRowId) <= this.getNodeDepth(parentRowId)) { break; }
    					tr = view.getRow(this.ds.indexOf(row));
    					if (tr) {
    						tr.style.display = "none";
    					}
    
    					selModel.selectNext();
    					row = selModel.getSelected();
    					if (row.id == currentRowId) { row = null };
    				}
    
    				selModel.selectRow(rowIdx, false);
    
    			}
    		}
    
    	},
    I also added a new style to align the +/i image with the row data:
    Code:
    /* ------------------------------------------------------- */
    /* Grid Style override for modded twistie  (plus/minus)    */
    /* ------------------------------------------------------- */
    .ext-nd-ed-twistie, .ext-nd-ed-blank {
      vertical-align:middle;
    }

  3. #3
    Ext User
    Join Date
    Apr 2007
    Posts
    189
    Vote Rating
    0
    captainm1uk is on a distinguished road

      0  

    Default


    Brilliant - works a treat

    Thanks

Thread Participants: 1

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