Sha256: 0ab30de2d823cdf0c0b426a5ac7f0d8d4e5c8f9c7f6395c9a4cc2aa79e537fdb
Contents?: true
Size: 1.43 KB
Versions: 4
Compression:
Stored size: 1.43 KB
Contents
Ext.define("Wando.RowSpanning",{extend:"Ext.grid.feature.Feature",alias:"feature.rowspanning",init:function(){if(this.independences&&this.independences.length){this.independences.forEach(function(a){this.dependences[a]=null},this)}this.grid.addCls("grid-row-span");this.grid.columns.forEach(function(a){if(this.dependences[a.dataIndex]||this.independences.indexOf(a.dataIndex)!=-1){a.renderer=this.genRenderer(a.renderer)}},this)},genRenderer:function(a){var b=this;return function(k,m,c,f,j,n){var g=n.model.getFields()[j].name,i=b.isStart(g,f),e=b.isEnd(g,f);m.tdCls+="row-span"+(i?" row-span-first":"")+(e?" row-span-last":"");var l="",d="";if(i){l="<div style='position: absolute; margin-top: "+b.getSpanningHeight(g,f)+"px;'>";d="</div>"}if(i){var h=a?a.apply(this,arguments):k;return l+h+d}else{return""}}},isStart:function(f,g){if(!g){return true}var a=this.grid.store.getAt(g),d=this.dependences[f];if(d&&this.isStart(d,g)){return true}var e=this.grid.store.getAt(g-1),b=(!d||a.get(d)!==e.get(d)),c=(a.get(f)!==e.get(f));return !d?c:(b||c)},isEnd:function(g,h){var b=this.grid.store;if(h>=b.getCount()-1){return true}var a=b.getAt(h),e=this.dependences[g];if(e&&this.isEnd(e,h)){return true}var f=b.getAt(h+1),c=(!e||a.get(e)!==f.get(e)),d=(a.get(g)!==f.get(g));return !e?d:(c||d)},getSpanningHeight:function(f,g){var c=g+1,a=this.grid.store,b=this.dependences[f];if(!this.isEnd(f,g)){while(!this.isEnd(f,c)){c++}c++}var d=20,e=10;return(d*(c-g)/2-e)}});
Version data entries
4 entries across 4 versions & 1 rubygems