Reason: jquery is simple, compatibility is good and easy to encapsulate. Do not say much nonsense, immediately start our jquery plugin write it. There should be a lot of people who have written similar plug-ins, and I also have some form of imitating FlexGrid.
Requirements: GridView display data, no refresh paging, no refresh sort, no refresh filter (search data), based on ASP.net (we have ashx general processing file to achieve).
Use to technology: asp.net2.0, JQUERY,CSS
The first is the jquery plug-in aspect, the use of the core function or jquery Ajax functions, convenient and quick.
Copy Code code as follows:
$.ajax ({
Type:p.method,
Url:p.url,
Data:param,
Success:function (msg) {
$. AddData (MSG,SHOWBOX,P);
},
Error:function (msg) {$. Errorajax (showbox,p.errormsg);},
Beforesend:function () {$. Addloading (Showbox);},
Complete:function () {$. Moveloading (Showbox);}
});
Look at this simple sentence, jquery is more fun. The specific code please download the following attachment view Oh.
First hair Zhang into the results of the picture to see (style is not very good-looking, need to weigh the change it)
Sorting and filtering functions
JQUERY+ASHX paging feature without refresh
In fact, here in addition to jquery as the main framework for the entire plug-in, another important document is ASHX this general processing file. Ashx in my entire Jquerygrid plug-in output {\ n page:1,\ntotal:0,pages:1,rows: ', cols: '} Such JSON code, I believe the friends who have used the josn understand. In order to reduce the error I used a Third-party plug-in Newtonsoft.json, which is the Jsonconvert.deserializeobject () format of the Json string.
Of course, this feature plug-in for Web applications and internal Web sites, for the site is somewhat inappropriate, after all, from the SEO perspective directly generated by jquery data is not a good way to display. Not much to say, you can look at my code, if the plug-in has better suggestions or changes welcome to exchange.
Jquery+ashx No refresh gridview data display plugin download