-
31 Jan 2008 1:41 AM #111
FIX: autoexpand + horizontal scrollbar
FIX: autoexpand + horizontal scrollbar
Hi there,
thanks for making this ux!
Unfortunately, when defining an autoExpandColumn, a horizontal scrollbar gets added, no matter what.
The above (untested) code fixes this .. just put it into BufferedGridView.js and enjoy ..Code:autoExpand : function(preventUpdate){ var g = this.grid, cm = this.cm; if(!this.userResized && g.autoExpandColumn){ var tw = cm.getTotalWidth(false); var aw = this.grid.getGridEl().getWidth(true)-this.scrollOffset; if(tw != aw){ var ci = cm.getIndexById(g.autoExpandColumn); var currentWidth = cm.getColumnWidth(ci); // fix for horizontal scrollbar display var cw = Math.min(Math.max(((aw-tw)+currentWidth), g.autoExpandMin), g.autoExpandMax) - 2; if(cw != currentWidth){ cm.setColumnWidth(ci, cw, true); if(preventUpdate !== true){ this.updateColumnWidth(ci, cw); } } } } },
Thanks again,
MartinLast edited by pluesch0r; 31 Jan 2008 at 2:01 AM. Reason: added fix.
-
31 Jan 2008 1:59 AM #112
I'm facing exactly the same problem here. Didn't find a solution yet.
My current code: http://pastebin.ca/884729
Regards, Elias P.
-
31 Jan 2008 3:14 PM #113
Solved: Livegrid + Grid Filter
Solved: Livegrid + Grid Filter
I found a solution for this -- I had already created a buildQuery function in the GridFilters definition. Whenever that function is executed to change the filters, I change the URL for the data store to pass the filter to the server:
thxCode:var url = '/cdt/grid_data'; var bufferedDataStore = new Ext.ux.grid.BufferedStore({ autoLoad : true, bufferSize : 300, reader : bufferedReader, sortInfo : {field: 'display_name', direction: 'ASC'}, url : url }); var filters = new Ext.ux.grid.GridFilters({ filters : [ {type: 'string', dataIndex: 'display_name'}, {type: 'string', dataIndex: 'infohash'}, {type: 'boolean', dataIndex: 'enabled'} ], buildQuery : function(filters) { var myarray = []; for(var i = 0; i < filters.length; i++) { myarray.push({'field' : filters[i].field, 'type' : filters[i]['data'].type, 'value' : filters[i]['data'].value}); }; filterstring = Ext.util.JSON.encode(myarray); bufferedDataStore.proxy.conn.url = url + "?filters=" + filterstring; return {'filters' : filterstring}; } });
m
-
4 Feb 2008 2:53 AM #114
Livegrid and RowNumberer
Livegrid and RowNumberer
My solution for combining Livegrid and RowNumberer:
- Define an extension of Ext.grid.RowNumberer:
- Use this class as a column in the ColumnModelCode:Ext.ux.grid.RowNumberer = Ext.extend(Ext.grid.RowNumberer, { renderer : function(v, p, record, rowIndex, colIndex, store){ if(this.rowspan){ p.cellAttr = 'rowspan="'+this.rowspan+'"'; } return store.getGridView().bufferRange[0]+rowIndex+1; } });
- Link both when creating the BufferedStore :Code:var colModel = new Ext.grid.ColumnModel([ new Ext.ux.grid.RowNumberer(), {header: "Ticker", width: 60, sortable: true}, ... ]);
It works.Code:this.view = new Ext.ux.grid.BufferedGridView({ .... }); new Ext.ux.grid.BufferedStore({ ...., getGridView: function(){return this.view}.createDelegate(this) });
Does anyone have a better solution ?
Thanks for your answers
-
5 Feb 2008 11:48 PM #115
How to download livegrid?
How to download livegrid?
I cannot access to http://www.siteartwork.de/2007/11/10...nt-with-extjs/ is has a message
" This Domain is currently inaccessible! "
Please post it to me.
thank a lot
-
7 Feb 2008 2:29 PM #116
LiveGrid + Editor Grid
LiveGrid + Editor Grid
Hi all,
Anyone had any luck plugging LiveGrid into an editable grid?
I'm having some success, but I'm having trouble getting record inserts to work without really messing up the grid view...
m
-
12 Feb 2008 7:39 AM #117
Anyone have the latest? I had to get a copy of the code from a chinese website, thx god I can read a little chinese. Anyhow it has alot of bugs\defects and I've fixed alot of them, but I was wondering if there was a more stable version available, and since I can't get to the guys domain says its down. Any help is appreciated. THx.
-
15 Feb 2008 6:00 AM #118
Ok I fixed it, what is happening is the scroll is being adjusted and the last row is not painted before other code runs so it doesn't exist and that causes the error.
In BufferedGridView.js in adjustScrollerPos add the marked line of code, it will force an update of the grid and make it all good. Enjoy.
Code:adjustScrollerPos : function(pixels, suspendEvent) { var liveScroller = this.liveScroller; if (suspendEvent === true) { liveScroller.un('scroll', this.onLiveScroll, this); } liveScroller.dom.scrollTop += pixels; this.onLiveScroll(); //forces grid to update fixed using arrow keys to move up from top or down from bottom. if (suspendEvent === true) { liveScroller.dom.scrollTop = liveScroller.dom.scrollTop; liveScroller.on('scroll', this.onLiveScroll, this); } }
-
19 Feb 2008 7:13 PM #119
Thanks!
Its good to see that people already thinking of mixing up FilteredGrid and LiveGrid.. I am trying one myself.. I'll post my codes once I get things up and running.
EDIT: Managed to get the LiveGrid working but I think my filters won't work because I set local:true for the filters.
Do I have to set anything within LiveGrid or do I have to set filters to remote? I am leaning on setting the filter to remote
but I have no script in handling filters on the server-side. >.<
I cannot post the filter data(sorry) but its just some Apache Velocity Template code.Code:var filters = new Ext.ux.grid.GridFilters({ local:true, buildQuery : function(filters) { var myarray = []; for(var i = 0; i < filters.length; i++) { myarray.push({'field' : filters[i].field, 'type' : filters[i]['data'].type, 'value' : filters[i]['data'].value}); }; filterstring = Ext.util.JSON.encode(myarray); bufferedDataStore.proxy.conn.url = GET_STUDY_DATASET_URL + "?filters=" + filterstring; return {'filters' : filterstring}; }, filters:[ /* some filter data here */ ]});

-
20 Feb 2008 12:54 AM #120
K has no properties.
K has no properties.
Hi,
I'm using this live grid in a sort of webmail projet. But when i scroll, I have the following error in firebug and the grid doesn't update.
I don't know why, so any idea is welcome.
You could try at www.kiwi-mail.fr login : demo/demo
Thanks in advance
K has no properties
GridView([Object name=type id=0 style=width:30px;text-align:left;, Object name=subject id=1, Object name=contact id=2, 3 more...], [undefined, undefined, undefined, 3 more...], Object autoLoad=true bufferSize=150 reader=Object, 93, 6, false)ext-all.js (line 141)
GridView(93, 93)ext-all.js (line 141)
replaceLiveRows(171, true)BufferedGridView.... (line 1371)
updateLiveRows(171, true, undefined)BufferedGridView.... (line 1222)
adjustVisibleRows()BufferedGridView.... (line 1477)
layout()BufferedGridView.... (line 434)
initComponent()ext-all.js (line 140)
initComponent(1043, 251)ext-all.js (line 62)
onLayout(Object x=0 y=0 width=1043 height=251)ext-all.js (line 70)
onLayout(Object initialConfig=Object layout=Object title=Messages, Object dom=div#ext-gen40.x-panel-body id=ext-gen40)ext-all.js (line 70)
ContainerLayout()ext-all.js (line 65)
onLayout(Object el=Object resizingEl=Object orientation=1, 200)ext-all.js (line 70)
Observable()ext-all.js (line 12)
Observable()ext-all.js (line 12)
SplitBar(Object browserEvent=Event mousemove button=0)ext-all.js (line 63)
apply()ext-base.js (line 9)
DragDrop(Object browserEvent=Event mousemove button=0)ext-all.js (line 31)
apply()ext-base.js (line 9)
DragDrop(Object browserEvent=Event mousemove button=0)ext-all.js (line 31)
EventManager(Object browserEvent=Event mousemove button=0)ext-all.js (line 13)
getViewWidth(mouseup clientX=0, clientY=0)ext-base.js (line 10)
[Break on this error] Ext.grid.GridView=function(A){Ext.apply(this,A);this.addEvents("beforerowremoved...


Reply With Quote