PDA

View Full Version : Pre Processing a grid in optimized way



pulkitagarwal
26 Dec 2010, 7:31 AM
Hi ,
I have this Pagination panel where I have to do certain action based on a boolean column (specifically different CSS) .
Now there are three things I don't know

1. How to do that ? Even if i use before render then I have to iterate over the entire records (Thats the only way I can think of now and don't know how to do that) which can be huge.
Is there a way to preprocess just the page that loads in panel . As then if suppose I jump from 1st to 10 page I would like to preprocess only the 10th page records.

2. How to know in these events about the records that will be displayed ? like if I use pagechange event then how to know the records at 10th page ?

3. Is there a way not to iterate over every record myself ? Some in built function ?

Thanks
Pulkit

mankz
26 Dec 2010, 8:54 AM
If all you need to do is to add css class to your rows you could use getRowClass on the GridView class. What sort of 'actions' do you need to do?

pulkitagarwal
26 Dec 2010, 9:20 AM
based on boolean value is false The row should be of Green Color and if true then Red .

mankz
26 Dec 2010, 9:29 AM
Ok, look up getRowClass in the API docs (GridView class)

pulkitagarwal
26 Dec 2010, 10:45 PM
In that function I just found out what the value of the column was and tada !

But again what is best way -- this is basically for Class .
Suppose i want to do a different action like creating a pop up only if click on certain rows
or or create a tool tip when hover on some specific rows .

What is to be used then ?
This is the serious question I have .
Even I am looking for the answer and will post as soon as i crack this .

Condor
26 Dec 2010, 10:57 PM
1. Specific action based on record: Simply check the clicked record values in the rowclick event.
2. Specific tooltip for record: Use the DataTip user extension.

pulkitagarwal
27 Dec 2010, 12:20 AM
Many Thanks =D>

I became a jerk .. it is so much clearer now .
Should have read the API before Posting this question sorry for that