From 8e85f95b05187bb7aa64637801e0e62a1c19efc1 Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Thu, 10 Feb 2011 17:51:44 +0800 Subject: [PATCH] roojs-debug.js --- roojs-debug.js | 47 ++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 40 insertions(+), 7 deletions(-) diff --git a/roojs-debug.js b/roojs-debug.js index 76ba5e34b0..7ee7880f2a 100644 --- a/roojs-debug.js +++ b/roojs-debug.js @@ -46436,12 +46436,20 @@ Roo.grid.Grid = function(container, config){ * @param {event} e The raw browser event */ "dragout" : true, + /** + * @event rowclass + * Fires when the dragged row(s) leave another DD target while being dragged + * @param {GridView} gridview The grid view + * @param {Object} rowcfg, contains record, rowIndex and rowClass - set rowClass to add a style. + */ + 'rowclass' : true, + /** * @event render * Fires when the grid is rendered * @param {Grid} grid */ - render : true + 'render' : true }); Roo.grid.Grid.superclass.constructor.call(this); @@ -47969,6 +47977,9 @@ Roo.extend(Roo.grid.GridView, Roo.grid.AbstractGridView, { var ts = this.templates, ct = ts.cell, rt = ts.row; // buffers var buf = "", lbuf = "", cb, lcb, c, p = {}, rp = {}, r, rowIndex; + + var hasListener = this.grid.hasListener('rowclass'); + var rowcfg = {}; for(var j = 0, len = rs.length; j < len; j++){ r = rs[j]; cb = ""; lcb = ""; rowIndex = (j+startRow); for(var i = 0; i < colCount; i++){ @@ -47990,14 +48001,24 @@ Roo.extend(Roo.grid.GridView, Roo.grid.AbstractGridView, { } var alt = []; if(stripe && ((rowIndex+1) % 2 == 0)){ - alt[0] = "x-grid-row-alt"; + alt.push("x-grid-row-alt") } if(r.dirty){ - alt[1] = " x-grid-dirty-row"; + alt.push( " x-grid-dirty-row"); } rp.cells = lcb; if(this.getRowClass){ - alt[2] = this.getRowClass(r, rowIndex); + alt.push(this.getRowClass(r, rowIndex)); + } + if (hasListener) { + rowcfg = { + + record: r, + rowIndex : rowIndex, + rowClass : ''; + } + this.grid.fireEvent('rowclass', this, rowcfg); + alt.push(rowcfg.rowClass); } rp.alt = alt.join(" "); lbuf+= rt.apply(rp); @@ -48010,6 +48031,8 @@ Roo.extend(Roo.grid.GridView, Roo.grid.AbstractGridView, { var ts = this.templates, ct = ts.cell, rt = ts.row; // buffers var buf = [], lbuf = [], cb, lcb, c, p = {}, rp = {}, r, rowIndex; + var hasListener = this.grid.hasListener('rowclass'); + var rowcfg = {}; for(var j = 0, len = rs.length; j < len; j++){ r = rs[j]; cb = []; lcb = []; rowIndex = (j+startRow); for(var i = 0; i < colCount; i++){ @@ -48031,14 +48054,24 @@ Roo.extend(Roo.grid.GridView, Roo.grid.AbstractGridView, { } var alt = []; if(stripe && ((rowIndex+1) % 2 == 0)){ - alt[0] = "x-grid-row-alt"; + alt.push( "x-grid-row-alt"); } if(r.dirty){ - alt[1] = " x-grid-dirty-row"; + alt.push(" x-grid-dirty-row"); } rp.cells = lcb; if(this.getRowClass){ - alt[2] = this.getRowClass(r, rowIndex); + alt.push( this.getRowClass(r, rowIndex)); + } + if (hasListener) { + rowcfg = { + + record: r, + rowIndex : rowIndex, + rowClass : ''; + } + this.grid.fireEvent('rowclass', this, rowcfg); + alt.push(rowcfg.rowClass); } rp.alt = alt.join(" "); rp.cells = lcb.join(""); -- 2.39.2