has anyone here used this, using json to feed it data, in an mvc environment? i'm debating whether to 'roll my own' or invest some time with it. obvious reservations include the fact that it won't produce an unobtrusive solution. or can it?
- Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
- Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!
looking for alternative to jqGrid in mvc asp.net
Collapse
X
-
-
Aye, I've done it. Using ASP.NET MVC that is.How did this happen? Who's to blame? Well certainly there are those more responsible than others, and they will be held accountable, but again truth be told, if you're looking for the guilty, you need only look into a mirror.
Follow me on Twitter - LinkedIn Profile - The HAB blog - New Blog: Mad Cameron
Xeno points: +5 - Asperger rating: 36 - Paranoid Schizophrenic rating: 44%
"We hang the petty thieves and appoint the great ones to high office" - Aesop -
hi hab, i should prob. have included a question with the o/p, beyond the unobtrusive bit, which clearly it can't be
did you use a cell array or named columns and if the second, did you use iqueryable?
taComment
-
First of all, a disclaimer, I’m not a techie; I just hack stuff together until it sort of works.
I have an async jqGrid on a view and it gets populated by making a call to the controller that returns a JSon result.
I nicked the code off of somebody’s web page but I can’t find it just now. I’ll have another look later as I think I’ll need to keep a record of this myself.How did this happen? Who's to blame? Well certainly there are those more responsible than others, and they will be held accountable, but again truth be told, if you're looking for the guilty, you need only look into a mirror.
Follow me on Twitter - LinkedIn Profile - The HAB blog - New Blog: Mad Cameron
Xeno points: +5 - Asperger rating: 36 - Paranoid Schizophrenic rating: 44%
"We hang the petty thieves and appoint the great ones to high office" - AesopComment
-
thanks hab. i think i wasn't asking the right question. i get the jquery grid stuff...more or less out the box. what i'm looking for is a solution that is unobtrusive...i think i will need to do it myself.
i can get the paging working properly, retrieving only the rows i need, but i'm having problems ajaxing it all.
so far i have in the html:
========================
.Code:<script language="javascript" type="text/javascript"> $(document).ready(function() { $("form#paging").submit(function(event) { event.preventDefault(); }); }); function hijack(form, callback) { $("#indicator").show; } </script>
.
.
.
=====================HTML Code:<table> <thead> <tr> <th>Make</th> <th>Model</th> <th>Mileage</th> <th colspan="3">Action</th> </tr> </thead> <% foreach (Car car in ViewData.Model) { %> <tr> <td><%= car.Make %></td> <td><%= car.Model %></td> <td><%= car.Mileage %></td> <td><%=Html.ActionLink<CarsController>( c => c.Show( car.Id ), "Details ") %></td> <td><%=Html.ActionLink<CarsController>( c => c.Edit( car.Id ), "Edit") %></td> <td> <% using (Html.BeginForm<CarsController>(c => c.Delete(car.Id))) { %> <%= Html.AntiForgeryToken() %> <input type="submit" value="Delete" onclick="return confirm('Are you sure?');" /> <% } %> </td> </tr> <%} %> </table> <div class="pager"> <% using (Html.BeginForm("Index", "CarsController", FormMethod.Post, new{ID="paging"})) { %> <%= Html.Pager(ViewData.Model.PageSize, ViewData.Model.PageNumber, ViewData.Model.TotalItemCount) %> <% } %> </div>
in the controller:
====================================
====================================Code:[Transaction] public ActionResult Index(int? page) { int currentPageIndex = page.HasValue ? page.Value - 1 : 0; int numCars = carRepository.GetAll().Count; IList<Car> cars = carRepository.GetAllPaged(currentPageIndex * defaultPageSize, defaultPageSize); return View(cars.ToPagedList(currentPageIndex, defaultPageSize, numCars)); }
the ToPagedList method returns all the paging links for the tabular data. i need a way to hook up the click event of each anchor tag of the paging to the js ajax handler...
...i realise that the j/script above is incomplete..it's just stubbed out for now.
...(wonder if this post will format)Comment
-
WTF has that lot got to do with jqGrid ????How did this happen? Who's to blame? Well certainly there are those more responsible than others, and they will be held accountable, but again truth be told, if you're looking for the guilty, you need only look into a mirror.
Follow me on Twitter - LinkedIn Profile - The HAB blog - New Blog: Mad Cameron
Xeno points: +5 - Asperger rating: 36 - Paranoid Schizophrenic rating: 44%
"We hang the petty thieves and appoint the great ones to high office" - AesopComment
-
sorry hab [keep yer hair on]. like i said, i posted the wrong question. i'm really looking for an alternative to the jqgrid, 'coz it don't degrade too nicely when users haven't got j/script enabled [not common i know, but...] and i also want more control over the rendering etc. and i also want to page more than simple tabular data - think asp.net repeater etc...
so again, apologies, it was my fault for a poorly titled thread and thanks for your help...promise..never do it again...must think more clearly...read before posting...don't mislead...
Comment
- Home
- News & Features
- First Timers
- IR35 / S660 / BN66
- Employee Benefit Trusts
- Agency Workers Regulations
- MSC Legislation
- Limited Companies
- Dividends
- Umbrella Company
- VAT / Flat Rate VAT
- Job News & Guides
- Money News & Guides
- Guide to Contracts
- Successful Contracting
- Contracting Overseas
- Contractor Calculators
- MVL
- Contractor Expenses
Advertisers
Contractor Services
CUK News
- How IR35 inflated an £8.5bn consultancy bill — and tests Burnham at the Budget Aug 28 07:47
- Autumn Budget 2026: FCSA’s 5 contractor asks of John Healey Aug 27 04:15
- Andy Burnham's Zoom gripe doesn’t apply to IT contractors, say recruiters Aug 26 03:41
- Check your Loan Recall paperwork for the Isle of Man: it could matter Aug 25 03:27
- Budget 2026: Contractor advisers ask for ‘IR35 reset’ Aug 24 04:57
- Why might an umbrella company fail to pay its total tax bill to HMRC? Aug 18 06:08
- Contractors, here are the late payment fixes that the Lords just turned down Aug 17 08:03
- How will HMRC's Direct Debit plan affect contractors paying VAT and PAYE? Aug 13 23:54
- HMRC's new 'reckless' tax offence: an IR35 game-changer for contractors? Aug 13 13:50
- “I’m not a Machiavellian overlord”: Adrian Sacco breaks his silence on the Contractor Loan Recalls Aug 13 06:50

Comment