I have just mastered the use of the Easyui control and started the project now. This project is a semi-finished, the front-end use of the ExtJS control, JSP without code, the reference to a lot of JS ... So there's a kind of a loss ...
To tell the truth special do not want to see the code, the first is not familiar with, the second is too messy and disorganized, there is a reason for the interface even HTML do not want to see and do not, the company to do this project, you can not talk with the company leaders said I will not,, so still have to look at the day.
Probably understand, began to Copy,past, the original module JS intact test to the JSP page, so it ran up, but the call is not my own method. Background business simple Ah, a moment to get the backstage, and then the interface JS URL path to their own. So far, the interface is there, the text box drop-down box is also out, the interface is also the controls.
ExtJS Chinese This box is much simpler than a drop-down box, and the drop-down box involves assignment, whether it is a dynamic assignment or a static assignment. Here's a look at the two assignments for the drop-down box.
1, static assignment. such as the Gender drop-down box
The code is as follows:
New Ext.form.ComboBox ({ name: ' usersex_id ', ID: ' usersex_id ', hiddenname: ' usersex_id ', typeAhead: True, triggeraction: ' All ', lazyrender:true, mode: ' Local ', store:new Ext.data.ArrayStore ({ Fields: [' value ', ' text '], data: [[' 1 ', ' Male '], [' 2 ', ' Female '] }), Valuefield: ' Value ', Displayfield: ' Text ', emptytext: ' Please choose Gender ', Editable:false, selectonfocus:true, width:85 })
Where the data array in the store item is the contents of the drop-down box, Emptytext is the information that is prompted when the drop-down box is empty
The display results are as follows:
2, Dynamic assignment
The code is as follows:
Get data var usersexstore = new Ext.data.Store ({proxy:new Ext.data.HttpProxy ({url: ' taskmanager.ered?reqcode= Querycommunity '}), Reader:new Ext.data.JsonReader ({}, [{name: ' value '}, {name: ' CommunityName '}]), listeners: {//Set remote number The initial value of the source drop-down selection box ' Load ': function (obj) {}}}); Usersexstore.load ();//dropdown box new Ext.form.ComboBox ({hiddenname: ' usersex_id ', Name: ' usersex_id ', id: ' usersex_id ', Emptytext: ' Please select,,, ', triggeraction: ' All ', Store:usersexstore,displayfield: ' Text ', Valuefield: ' Value ', mode: ' local ',//data will be read automatically, if set to local and call Store.load () will be read 2 times, or it can be set to local, and then through the Store.load ( ) method to read Editable:false,anchor: ' 100% ' })
The result returned by the URL is "[[" 1 ", ' Male '], [" 2 ", ' Female ']]" format data, when using dynamic assignment, be sure to set the Hiddenname property of the ComboBox, TriggerAction: ' All ' When you select one of the other items in the Function drop-down box for multiple values, the other items are not lost, and the other entries are not set.
ExtJS still continue to study, or that sentence copy past it, if just want it difficult, then it is really difficult, to do, to make it is not difficult ....
ExtJS drop-down box