-
10 Sep 2008 7:50 AM #301
Thanks for your help.
However if I replace this line :
with this line :Code:mygrid.getView().updateLiveRows(grid.getView().lastRowIndex,true,true);
The data is well refreshed however the vertical scroll is also reset I start reading the datagrid from the beginning. (It is the same action as the refresh button in the bottom toolbar).Code:mygrid.getStore().load();
Is there a better way to refresh only the current visible part of the grid?
The final idea is to use highlight color for each updated rows like this:
Thanks.Code:var row = grid.getView().getRow(rowIndex); if(row!=null) { var el = Ext.fly(row); el.highlight(color,{"duration":3.00}); }
-
10 Sep 2008 9:15 AM #302
-
10 Sep 2008 11:27 PM #303
To pass aditionnals filters or parameters to the server I use session's attributes.
-
11 Sep 2008 12:44 AM #304
Hi,
a filter should be used server side. Here's how I pass additional parameters if I want to change the result set that should be rendered into the view:
First off, you need to tell the grid that the data in the store has changed: You can d this by calling the
method of the grid's view and by passing "true" as the argument:Code:reset()
This forces the grid to request data from the server by totally resetting all properties - the view gets refreshed, then. Passing arguments to the server can be done by changing the attributes of the params-object that is used to communicate with the server. This is an example of sending additional parameters to the server - you must specify an event listener for the grids store's "beforeload"-event:Code:this.grid.view.reset(true);
Code:onGridStoreBeforeLoad : function(store, options) { if (!options.params) { options.params = {}; } options.params.filterField = 'someField' }
Please note that the "beforeload" event of the grid's store only fires "once": When requesting new data for buffering, the "*buffer" events will be triggered. However, arguments you have passed to the server using the above method will still exist in the params-obejct.
To reset the grid and to refresh the view , just call "reset(true)" and make sure you change the "beforeload"-listener accordingly.
-
11 Sep 2008 12:46 AM #305
-
11 Sep 2008 12:52 AM #306
I still don't fully understand what you are about to do, however I can give you a few hints, I guess.
1) If you take a look at the "processRows()" method of the grid view, you can see how grid rows get painted "selected". You could probably override this method and implement additional logic for highlighting your rows.
2) Use a field in a record which is used to represent a data row. Change the attribute of the record, for example "highlited", whenever you want to paint the record as highlighted (true/false)... then add you own renderer which is used to paint the row according to the "highlighted"-property of the record, just like you would do it in a normal grid.
This would probably be the recommended method...
-
11 Sep 2008 4:25 AM #307
Hey nctag,
I just tried to reproduce your error, but had no success. I guess it's related to Ext 2.2 which I currently do not use yet. If you can reproduce this error with 2.1 and the latest Livegrid version out of the trunk, just tell me, otherwise I'll postpone this bug to the 0.3 release.
-
11 Sep 2008 6:01 AM #308
-
11 Sep 2008 6:06 AM #309
-
11 Sep 2008 7:31 AM #310
I confirm that it is a Ext 2.2 only bug. So don't care about it until the 0.3 release. I thought it would be clear that it's only for Ext 2.2. I am very sorry.
But I have got another question.
Is it possible to set the position to a specific record?
Let's say we have 10000 records in the livegrid. I now want to go per a button to the 5869. Record because this record is relevant in an other context. So I have to set the position to record 5869. It must be possible because you set the position also when a user uses the scroll bar. But I could not find the right way up to now. Do you have an example how to realize it correctly?
Thank you very much and


Reply With Quote


