Spliced Data Display
Display in different formats
Introduced js and css <link rel = "stylesheet" type = "text/css" href = "themes/default/easyui.css"/> <link rel = "stylesheet" type =" text/css "href =" CSS/icon.css "/> <link rel =" stylesheet "type =" text/css "href =" CSS/demo.css "/> <script type = "text/javascript" src = "JS/jquery. min. js "> </script> <script type =" text/javascript "src =" JS/jquery. easyui. min. js "> </script> <div class =" searchLock "style =" width: 35% "> <divclass =" panel-title ">
.
Function getSelections () {var ss = []; var rows = $ ('# tt '). datagrid ('getselections'); if (rows. length> 0) {if (confirm ("are you sure you want to add the selected records? ") {For (var I = 0; I <rows. length; I ++) {var row = rows [I]; // ss. push ('<span>' + row. productid + ":" + row. attr1 + '</span>'); ss. push (row. productid + "," + row. attr1 + "," + row. itemid + "," + row. listprice + "," + row. status);} var id = ss. join (','); var test = "addc"; $. ajax ({url: "SetMenun. ashx/ProcessRequest? Id = "+ id +" & test = "+ test, success: function (text) {// grid. reload () ;}, error: function () {}}) ;}alert (id) ;}else {alert ("select a record") ;}$. messager. alert ('info', ss. join ('<br/> '));}
General Handler
Public class SetMenun: IHttpHandler {BLL. userColumInfoBLL columinfobll = newuserColumInfoBLL (); BLL. userMenuInfoBLL menuinfobll = newuserMenuInfoBLL (); BLL. columBLL columbll = new columBLL (); public void ProcessRequest (HttpContextcontext) {// context. response. contentType = "text/plain"; // context. response. write ("Hello World"); string command = context. request. queryString ["test"]; if (command = nul L) {QueryColum (context);} // Add the selected column if (command = "addc") {AddColum (context );} // Add the selected menu if (command = "addm") {AddMenu (context);} // query the column if (command = "queryc ") {QueryColum (context);} // Add the menu if (command = "querym") {QueryMenu (context );} // Delete the column if (command = "deletec") {DeleteColum (context);} // Delete the menu if (command = "deletem ") {DeleteMenu (context) ;}/// <summary> // Add a topic Record /// </summary> /// <paramname = "context"> </param> public void AddColum (HttpContextcontext) {// entity columEntity = newcolumEntity (); menuEntity = newmenuEntity (); PublicClass test = newPublicClass (); string strresult = ""; // TODO: // assign values to the object loop // split method to filter fields: // TODO: the String [] list = context needs to be verified in person. request. queryString ["id"]. split (','); int count = list. length; // if, based on the data transmission fields of each row Add processing. For (int I = 0; I <count; I = I + 5) {// column ID columEntity. columID = I + 1; // column name columEntity. cName = list [I]; columEntity. cAddress = list [I + 1]; columEntity. cOpenType = list [I + 2]; columEntity. cOrder = list [I + 3]; // columEntity. columID = Convert. toInt16 (list [I + 4]); // other1 is used to add user menuEntity. other1 = context. server. urlDecode (context. request. queryString ["UserName"]); test. setObj (columbll); // call Class try {// call the Public processing class method. This method matches the required class. If (test. add (columEntity, null, null) {strresult = strresult + "true";} else {strresult = strresult + "false" ;}} catch (System. exception ex) {throw ex ;}} int number = strresult. indexOf ("false"); if (number =-1) {context. response. write ("T");} else {context. response. write ("F ");}}}