Closed LawrenceWeng closed 10 years ago
If you pass {orderBy: "someColumn", sort: "DESC"}
as options into your grid call you can get an order by.
nRowsShowing should work, can you show me an example page where it's doing 1-7 then 7-10?
Thanks!
Thank you very much for the quick response. :+1:
After trying that I can see that what I'm trying to do isn't going to be simple. I am passing in a generated sql script at run time so I may not know what columns exist. Optimally my query would return a rownum as the first column. Unfortunately, mysql has no rownum feature and any attempts to replicate it require variables which I cannot use in a view. But I digress, this is a mysql problem not a shortcoming with your library.
As for the number of records showing I think this picture explains it better. In the example you have 'nRowsShowing' set to 20 but only 7 rows are shown on the screen. Records 8 - 20 are only viewable with a scrollbar. (I am a very beginner web developer so I have a feeling that this too will not be a downfall of your library.) http://imgur.com/B438tQo
Thanks again, Alex
Additional: I can't seem to find any mention of {orderBy: "someColumn", sort: "DESC"}
on your API page.
Yea, i need to update the docs with that. But it is in the code commented. Your image shows 7, but there is a scrollbar to show the rest of the 20. If you wanted all 20 to be "visible", just change the CSS height. nRowsShowing is === number of rows to show per page. You still have to scroll because of the fixed height.
Thanks. The rows showing is just the CSS height (and my lack of web dev knowledge). Thanks for the order by as well. It appears that what I'm trying to do with that is not possible due to MySQL limitations.
Thanks again for OpenJS Grid!
Two Questions.
I understand that these things may be out of scope of OpenJS Grid but any points in the right direction would be greatly appreciated. Also, thank you very much for releasing this.
Alex