jQWidgets Forums
Forum Replies Created
-
Author
-
May 29, 2013 at 2:19 pm in reply to: grid datasource recordstartindex grid datasource recordstartindex #22048
Hi Peter,
I studied the samples (including this one) a few times in the past. The server_side_grid_filtering_and_virtualscrolling seems to confirm my previous comment. The server side uses the recordsstartindex as the ‘LIMIT $start, $total_rows’ value for the query (meaning the starting point where 0 is the first record).
So, as far as I understand the sample code suffers from the exact situation I described above. When I set a filter that does have records but less than the recordstartindex is returns zero records. The sample should not use updatebounddata but set the source property instead.
Ton
May 29, 2013 at 1:19 pm in reply to: grid datasource recordstartindex grid datasource recordstartindex #22039Hi Peter,
That makes sense, thanks for clearing this up.
One more question: wouldn’t this also apply when some filter is set? Let’s say I have 20 records when not filtered and I’m at offset 10 (due to scrolling). Then I set some filter which will cause only 5 records to be available. The server wil then find no records since the offset is beyond the new record set, causing zero records to be returned (while actually records are available).
To prevent his situation, the updatebounddata should never be used in situations like this. In other words, only use updatebounddata if you expect new records to be added at the end of the existing record set and don’t apply any filtering, change in order, etc. Is that a correct interpretation?
Ton
May 29, 2013 at 12:16 pm in reply to: grid datasource recordstartindex grid datasource recordstartindex #22027Hi Dimitar, Peter,
Thanks for your input, I guess I’m doing something wrong in explaining my issue. Let me try again to see if I can explain it properly. The issue is not related to filtering, I used that as an example to indicate my problem is related to a grid data reload that brings in new content.
My problem:
1. I have a grid loaded with data – all fine.
2. The grid is scrolled down a bit (causing a few server calls), recordsstartindex is non-zero – all fine
3. I now manually execute an updatebounddata (I want to reload the grid with some new data)At 3 things goes wrong: the recordstartindex was non-zero at step 2 (ok). But for step 3 I need it (the recordstartindex) to be zero since my new data is unrelated to the data at steps 1 and 2. However, the updatebounddata does not internally reset the recordstartindex to zero. So, whats happens at 3 is: ‘load new data but load it at the offset from step 2’.
To fix this I did:
3a: .recordendindex -= .recordstartindex; .recordstartindex = 0;
3b: call updatebounddataThis fix solved my problem. However, I now (I fixed this weeks ago) run into a new problem which is caused by some kind of internal grid issue. Which is logical because in step 3a I interfere with grid internal data.
So, since fix 3a is no longer working I need another solution. Most likely it would seem to me that the grid should – when updatebounddata is called – reset recordsstartindex (and related values, e.g. the internal datasource copy).
Ton
May 29, 2013 at 10:44 am in reply to: grid datasource recordstartindex grid datasource recordstartindex #22014Hi Dimitar,
I don’t call updatebounddata during scrolling (it would not make a lot of sense to do that). I have a grid and at some point it was scrolled down. Then (after a user did some filter setting and clicks some reload button) I call updatebounddata to read new content. _Because_ the grid was scrolled down it (still) has a non-zero recordstartindex. This is not reset by the updatebounddata call, causing invalid data to be returned and displayed. Also see my previous explanations above.
Ton
May 28, 2013 at 3:30 pm in reply to: grid datasource recordstartindex grid datasource recordstartindex #21974Hi Dimitar,
The situation is a bit different. The problem is with updateboundata if I manually call it to refresh or otherwise change the grid content. And the problem occurs if at that moment the grid content is scrolled. In that case, the call that I make to updatebounddata does not reset recordstartindex. So, new data comes in due to my call but it is displayed at the previous offset (and the previous offset is also used in the call itself). For example:
I have data loaded in my grid that has records 1 – 20. I scrolled 2 record down so record 3 is the topmost visible. Now, I change some parameter (e.g. I filter for odd rows only) and call updatebounddata. The call goes out to my server which needs to return record 1, 3, 5, etc. However, my server also receives recordstartindex 3 so it returns records 5, 7, 9, etc. instead.
What I would like in this case is that the updatebounddata resets the recordsstartindex (and possibly related variables) to zero.
Ton
January 10, 2013 at 9:32 pm in reply to: virtualmode page scrolling virtualmode page scrolling #13461Works like a charm now, thanks for the help.
Ton
January 8, 2013 at 9:10 pm in reply to: virtualmode page scrolling virtualmode page scrolling #13316Hi Peter,
Thanks for the information. However, after some experimenting I’ve not yet been able to solve my issue. Since the scrolling is set using a pixel measure and I want to scroll an exact amount of rows, I somehow need to convert or adjust for that. I use a rowsheight of 20 and lets suppose I have a grid height set to 200. But that includes the grid header and the border so I can’t know exactly how many rows I have, this way I can’t say 200/20 = 10 rows further on. In fact it displays 8 rows plus a small white area at the bottom. And so I don’t know what verticalscrollbarlargestep I need to set in order to scroll exactly the number of pixels to get precisely to a new page. My guess is that I am missing something and therefore trying to solve this in a too complicated way. Would it be possible for your example I mentioned above to demonstrate an page scroll so that it goes to row 14 after the first scroll down? Or do you have some other info that I might be missing?
Best regards,
Ton
-
AuthorPosts