Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by ivan on Apr 24, 2008 15:19
open dhtmlx forum
smart rendering problem

Hi,

I am implementing the dhtmlxgrid to loading 2000 records for an web application. I am using smart rendering mode with dynamic pulling data from oracle database. It was working fine for the first 300 records. Then it start skipping with empty rows show up. I search the KB from others. It seems related to the row height and pos start/count problem. I am sure we are using the default row height. I have few questions.

From the "50,000 re cords in grid" sample, it seems total_count of records is only calculated when the posStart is 0 which is the first time the grid get loaded. So when we scroll down the grid, the total_count value in the xml is 0? is that right ?

Also how does count value that the grid fire up in the request? When i debug the code, it's different every time. And is there a correlation between the count and posStart? In oracle, the implement is bit different than mysql. They use row_number for that purpose. In my case, I need to put first_rows(count) and rownumber between posStart and posStart+count ?

select *
from (
select /*+ first_rows(50) */
your_columns,
row_number()
over (order by something unique) rownumber
from your_tables )
where rownumber between 50 and 100
order by rownumber;




thanks
Ivan
Answer posted by Support on Apr 25, 2008 03:30
>>So when we scroll down the grid, the total_count value in the xml is 0? is that right ?
The total_count attribute checked only on initial XML load, its value in any next xml chunks will be ignored, so it may have any value, or be skipped at all.

>>Also how does count value that the grid fire up in the request?
By default grid calculate count as = height_of_visible_area/height_of_row + prefetching_count
where prefetching_count calculated based on current view state ( it allows to load some additional data, so if user scroll just few rows up or down the grid will be able to render necessary row without sending additional request to server ). This value can be set as third parameter of enableSmartRendering

>> I need to put first_rows(count) and rownumber between posStart and posStart+count
This is correct, the "posStart" is a position from which you need to output "count" of rows