jqGridWS
Description:
- Provides R.A.D. experience for jQGrid 3.5 beta
against an asp.net .asmx webservice and SQL Server database.
- Requires minimal coding and configuration.
- Supports dynamic queries against any number of tables/views one endpoint. (Stored Procedure support soon)
- Recognizes and supports jQGrid sort/page/filter parameters.
Usage:
Server Side:
- Build simple DTO objects in the shape of the tables you would like to fetch.
- Add an XmlInclude attribute for each of these objects to the one-line webservice method.
Client Side:
- Set up your grid with a bit of meta-data and point it at the web service.
Comments and suggestions should talk to the blog
LIMITATIONS/RESTRICTIONS:
- Currently no support for FK relation lookups. You can use a view if you need lookups.
- tables/fields must be implemented as concrete dto classes with matching matching table/class field/property names.
- Currently supports ONE search/filter term only. The filter UI will let you stack them up. Go ahead, if you like, but the
results will not be pretty. Will implement soon. Does not fall into my current requirements.
TODO:
- Support stored procedures.
- Implement attribute base field/table mapping to remove requirement of field name/column name and tablename/dto name parity.
- Implement hierarchical and nested set support.
- Implement Insert/Update/Delete support.
- Ensure feature/data structure parity between XML/JSON from same endpoint.
- More robust type mapping serverside.
- OR - build a dynamic type generator that implements IXmlSerializable. I think this is the ticket. Expensive ticket but sounds
like a silver bullet to me.
- I do NOT want to just churn out xml into a stream. You can use an .asp/.php file for that.
jQGrid BUGS/ISSUES:
While this is not a page about jQGrid, while implementing this data service I, and you will too, notice some bugs in the
3.5 beta version of jQGrid.
- jQGrid is stepping on json2.js so I have to remove the singleton check at the beginning of json2.js and force it to overwrite
otherwise you lose JSON.parse(). Tony should be addressing this in the next version.
- jQGrid test database is weak but I am lazy. Maybe one or both of those things will change soon. (this is the reason there
are only 10 rows to page filter and sort amongst)
- In IE: Page buttons not working - might be me, might be the grid. Will look into it but in the meantime you can enter a
page number in the box and hit enter and magix happens.
- If you roll the grid up with the collapse button it won't be back any time soon. Refresh the page. Of course mozilla
browsers rock out with thier... ummm.. don't miss a beat.