Mark,
If you remember I was doing the project that searched a large amount of data with the auto search (onkeypress) functionality. I showed you a few demos. (but i never used a id, which you fixed)
All is working fine, except I came across a small problem which is related to the LIMIT (mysql) whilst scrolling. I fixed it, but i just wanted to run it by you to see if there was a better way.
Example:
Lets say i'm showing 20 (rownum=20) records in a grid with scroll:1, i have a 1000 records and i filter the grid on a keypress (like the advanced search bigset.php demo). If scrollbar is not touched all is fine, records are shown and filtered.
If i scroll to the bottom of the grid then i do a keypress to search the grid, if the record is in the data above (but out of range of teh LIMIT ) say the first 20 records out of 1000, then I get NO RECORDS found. UNless i then move the scrollbar to the top and the filtered grid is shown.
I understand why, because of the LIMIT in the SQL, as strStart might be 980 limiting for 20 records, but the filtered record is in the first 20 records (LIMIT 0,20).
I got round it by setting the scroll:0 and then to 1 like this:
'Filter data, turn off true scrolling to force grid to top.
$(”#list”).setGridParam({url:”newtabledata.asp?getItem=”+getItem+”&getBatch=”+getBatch+”&getCast=”+getCast,page:1,scroll:0}).trigger(”reloadGrid”);
'Refresh grid this forces scroll bar to pop to top and show data from 'above' if it didnt fall in the LIMIT range
$(”#list”).setGridParam({scroll:1}).trigger(”reloadGrid”);
Hope you understand what i mean.
Is there a nicer way to do this, like setting the scrollbar to the top of its range automatically.
Initailly i tried resetting the strStart to 0, if the search boxes had been keypressed, if sort of worked but still left the scrollbar at the bottom
Regards
MarkC
Can show a demo again if you need.
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top