DatatGrid operation in easyUI

Source: Internet
Author: User

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 ");}}}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.