One design item invokes another design item (list interface supports multiple selection)

Source: Internet
Author: User

Detailed description

For example, there is a "check" button on the project management design item, and when you click the Check button, you bring up the list interface of the user management design item and select multiple records on the list of user management design items that are paged out.

When you close the User management list, the username in the selected record is assigned to the Jiancharenyuan field in the entity that corresponds to the schema management design item.

Front-end Sencha.cmd JS code in the "Check" button on the "Schema management" Design Item List

1 function(button, record, E)2 {3     Debugger;//interrupt the Debug command, you can manually delete it4 5     varme = This;//This is a list view controller6     varViewModel = This. Getviewmodel ();//get the View model7     varGrid = This. GetView ();//get to List view8     varRecords = Grid.getselectionmodel (). GetSelection ();//gets the selected array of records9     varRecord=records[0];//if it is Radio mode, get to the 1th selected row recordTen     One  A     if(Record.get (' shifouguidang ') = =true) -     { -Ext.Msg.alert (' message box ', +record.get (' fanganmingchen ') + ' scheme has been archived cannot choose to check people! ‘); the     } -     if(Record.get (' Xiafashijian ')! = "" | |NULL) -     { -Ext.Msg.alert (' message box ', +record.get (' fanganmingchen ') + ' program has been issued cannot choose to check the person! ‘); +     } -     if(Record.get (' shifouguidang ') = =false&&record.get (' xiafashijian ') = = "" | |NULL) +     { A  at         varWin = ext.create (' Ext.window.Window ', { -Title: ' Select ' +record.get (' Fanganguanli ') + ' inspectors ', -Height: ' 60% ', -Width: ' 60% ', -Closable:true, -Hideheaders:true, inLayout: ' Fit ', - items: { toXtype:util.getCodeGenerate1ClassName (' User management ', ' list '), +TitleNULL, -JianGuanRenYuanID:record.get (' Jianguanrenyuanid '), theStore:Ext.create (Util.getcodegenerate1classname (' User management ', ' Store '),{ *Httpgetrequestexparams: {//a multi-field query condition can be received if the use of our code requires only the parameters in the Querycondition method (which is included in the default generated list () method). We recommend using our code $ querycondition: {Panax Notoginseng jianguanrenyuanid:{ -Value1:record.get (' Jianguanrenyuanid '), theCompareMode: ' Equals '//How to compare when querying +                             } A                         } the                     } +                 }) -             }, $ listeners:{ $Closefunction(ct,eopts) -                 { -                     varRecords = Ct.down (' Grid '). GetSelection (); the                     if(record.length==0) -                         return;Wuyi                     Else the                     { -                         varJianguanrenyuanids = []; Wu                         varJianguanrenyuans =[]; -  AboutExt.Array.each (Records,function(record) { $Jianguanrenyuanids.push (Record.get (' ID '))); -Jianguanrenyuans.push (Record.get (' UserName '))); -                          -                         }); A                         varparams = { + Jianguanrenyuans:jianguanrenyuans, the Jianguanrenyuanids:jianguanrenyuanids, -FangAnGuanLiID:record.get ("ID") $                         }; theAjax.get ('/pc/fanganzhixingpublic/xuanzeduogejianguanrenyuan ', params). Then (function(response, opts) { the  the                             if(response. Success) { theGrid.getstore (). reload ();//a pop-up message box that shows the success information returned in the background. As a best practice, it is recommended to display the information returned in the background (1, security, 2, the front-end should be only to show less involved in business logic. ) -}Else { inExt.Msg.alert (' message box ', Response. Errors.join (' request not successful '));//pop-up message box to display error or failure information returned in the background the                             } the  About                         });  the                     } the                 } the             } +         }); -     the Grid.add (Win);Bayi Win.showby (grid); the    } the}

The method in the back-end VS.Controller.cs file is

1          PublicHyresultbase Xuanzeduogejianguanrenyuan (string[] Jianguanrenyuans,string[] jianguanrenyuanids, Guid fanganguanliid)2         {3 4             varR =Newhyresultbase ();5             varFanganguanli = _ioc. Query<fanganguanli>()6. Where (E = E.id = =fanganguanliid)7                 . FirstOrDefault ();8             vars ="";9             varQ ="";Ten              for(vari =0; i < jianguanrenyuanids.length; i++) One             { AQ + = Jianguanrenyuanids[i] +","; -             } -              for(varj =0; J < Jianguanrenyuans.length; J + +) the             { -s + = Jianguanrenyuans[j] +","; -             } -Fanganguanli.jianguanrenyuanid =Q; +Fanganguanli.jianguanrenyuan =s; - fanganguanli.update (). Savetodb (); +R.success =true; A             returnR; at  -}

One design item invokes another design item (list interface supports multiple selections)

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.