I am running a code with ASP .NET MVC jqgrid that populates the grid with data from the database.
The code is taken from :
http://jetmathew.wordpress.com/2011/03/02/asp-net-mvc-2-with-entity-framework-json-jquery-and-jqgrid/
The problem is that when I go to second page and sort the data with any column. It sorts the whole data but takes me to 1st page.
I want to remain on second page with whole sorted data. Is this a bug? And is there anyway around to get things go my way?
The sane thing is happening on all examples on this link as well.
http://www.trirand.com/blog/jqgrid/jqgrid.html
It's not a bug. Think about it, what meaning does the pagenumber have when the sortcolumn changes? IMHO none since you are looking at a different dataset...
What are you trying to achieve here?
edit
Craig Stuntz added Jquery BBQ integration to Jqgrid. This enables url history to jqgrid.
Using this you can take the current page from the querystring.
http://craigstuntz.github.com/jqGrid/
I still stand by my original answer though :)
/Daddy
Related
I have data in Grid.MVC and now I want export data after filtered or sorted. I don't know how to do it.
Please help me.
Thank all.
I need to export the data in Grid.MVC to Excel. I used the solution in this link:
http://www.adambielecki.com/2013/05/exporting-data-to-excel-and-csv-in.html
It working but i have a problem, i want export data after filted or sorted.
So heres the help I can give you... I had to do this a few years ago with the same technology. Think of the Grid.MVC filtering as "client side". On the server's point of view, the bucket of objects filling the table has not changed when you do filtering, so what I had to do was hook into the filterboxes on the top of the grid by their css names and use a post back of filter objects to the viewbag which were then used in a linq query to filter the objects to the set I desired, from there I was able to export. This was super hard, and I cant access any of my old code b/c it was for a different company.
I would suggest not puttin the effort in, see if your users are okay with "post filtering" since excel is pretty much made to filter / sort data anyways.
Sorry I could not be more help but I hope this gets you started. good luck.
For the pagination I went through the documentation and understood that it is based on a cursor where you have to specify it to navigate back and forth. I have a requirement to navigate to first page and last page. Like you normally see in conventional Jquery or related grids with 4 buttons. Is this achievable? Also I would like to show the current page of the cursor like "Page 2 of 10". Is there anyway I can get this record count in the same response when you query?
Unfortunately, there really isn't a way to get to the last page. What you are describing is generally referred to as "limit,offset paging", which is common in MySQL or Postgres.
Usergrid currently only supports cursors. Due to the nature of the way cursors work, you have to navigate through the results in a linear fashion, starting at the beginning.
I am building a media library from a tutorial to get up to speed on MVC 4. I did the whole thing and now I'm re-building it using jQuery Mobile. The only piece I've yet to find simple is paging which should be easy. Can someone steer me in the direction of a nice tutorial on the subject?
We do have similar kind of Use case.
Store the Data in Session object in the form of Dictionary in this form.
On click of Next or previous button in Pagination control, fetch data from Controller, bind data to appropriate control in the UI and show data.
Make sure to show only limited data in UI. Restrict the number[max 10 per page]
Format Dictionary
I am using jquery DataTables to populate tables. We can get huge size of data and render it on html and put pagination/search etc using DataTable. I haven't used it earlier but I assume that it will die sometimes (after a limit). And anyways, bringing whole data in one go might not help in future.
Is there any way to make ajax calls when user reaches the last page of DataTable and fetch remaining data?
I hope, I am clear. Any alternative to perform this job will be helpful.
Thanks,
Jquery DataTables has the ability to use server side paging. You can find detailed information here: Server Side Paging Documentation
I'm having a problem with a page I'm developing in umbraco. I'm fairly new to it so would really appreciate some guidance.
the problem seems to be connected to the way umbraco caches pages.
what i have is a stockist locator map (a map of Australia in my case).
from this page, the user can select a region to see stockists within that area.
i have a big fat search button along with some checkboxes for the user to choose what region they want to search in.
when i check say 'Sydney' and hit my search button, all is well. it returns the results i would expect.
but... if i go and click the search button straight away (again) - then the search results disappear.
its almost like umbraco is doing some weird caching thing. I've tried fiddling with the caching settings within the developer area (i.e. 'Cache Period'), but haven't spotted any consistent patterns which shed light on the problem.
oh, another thing - its not executing the page load and pageInit events (when retrieving from the cache).
So when you submit you control without selecting anything, you get empty result. Can this be, that is the logic of a control itself? As I see, it just gives empty result for empty search query.
Can you provide some sample code to demonstrate your implementation?
I've done plenty of Umbraco sites and have rarely found that Umbraco interrupts the normal ASP .Net page lifecycle so I'd be more inclined to guess you have a fault in your code.
Have you tried disabling your custom caching completely to ensure that the issue does not relate to your code?
Does your cache have a param dependency that is being cleared or anything?