최근 참여한 프로젝트에서 ComboBoxTree의 효과를 구현해야 하는데 먼저 효과를 살펴보겠습니다...
Extjs에는 그런 효과가 없어서 작성하게 되었습니다. 직접 보고 인터넷에서 보시고 다른 분들의 정보를 보고 제가 직접 정리해서 수정했습니다.
Ext.ux.TreeCombo = Ext.extend(Ext.form.ComboBox, {
생성자: 함수(cfg) {
cfg = cfg || {};
Ext.ux.TreeCombo.superclass.constructor.call(this, Ext.apply({
maxHeight: 300,
editable: false,
mode : 'local',
triggerAction: 'all',
rootVisible: false,
selectMode: 'all'
}, cfg))
},
store: new Ext .data.SimpleStore({
fields: [],
data: [[]]
}),
// 트리 노드를 확장해도 드롭다운 상자가 닫히지 않도록 onViewClick을 다시 작성합니다.
onViewClick: 함수(doFocus) {
var index = this .view.getSelectedIndexes()[0], s = this.store, r = s.getAt(index)
if (r) {
this.onSelect(r, index);
}
if (doFocus !== false) {
this.el.focus()
}
},
tree: null,
// 숨겨진 값
hiddenValue: null,
getHiddenValue: function () {
return this.hiddenValue;
},
getValue: function () { //적용성을 높였습니다.
return this.hiddenValue;
},
setHiddenValue: function(code, dispText) {
this.setValue(code); .form.ComboBox.superclass.setValue.call(this, dispText);
this.hiddenValue = code;
},
initComponent: function () {
var _this = this; var tplRandomId = 'deptcombo_' Math.floor(Math.random() * 1000 ) this.tplId
this.tpl = ""
this.tree = new Ext.tree.TreePanel({
border: false,
enableDD: false,
enableDrag: false,
rootVisible: _this.rootVisible || false,
autoScroll: true,
trackMouseOver: true,
height: _this.maxHeight,
lines: true,
singleExpand: true,
root: new Ext.tree.AsyncTreeNode({
id: _this.rootId,
text: _this.rootText,
iconCls: 'ico-root',
expanded: true,
leaf: false,
border: false,
draggable: false,
SingleClickExpand: false,
hide: true
}),
loader: new Ext.tree.TreeLoader({
nodeParameter : 'ID',
requestMethod: 'GET',
dataUrl: _this.url
})
})
this.tree.on('click', function (node) {
if ((_this.selectMode == 'leaf' && node .leaf == true) || _this.selectMode == 'all') {
if (_this.fireEvent('beforeselect', _this, node)) {
_this.fireEvent('select', _this, node);
}
}
})
this.on('select', function(obj, node) ) {
var dispText = node.text;
var code = node.id;
obj.setHiddenValue(code, dispText)
obj.collapse()
}; 🎜>this.on('expand', function () {
this.tree.render(tplRandomId);
})
Ext.ux.TreeCombo.superclass.initComponent.call(this);
}
})
Ext.reg(" treecombo", Ext.ux.TreeCombo)
그런 다음 Extjs 클래스 라이브러리를 추가하세요
그 중 login.js의 코드는 다음과 같습니다.
/* 파일 생성일: 2013년 5월 27일 */
Ext.onReady(function () {
var _window = new Ext.Window({
title: "Query Condition" ,
renderTo: Ext.getBody(),
frame: true,
plain: true,
buttonAlign: "center",
closeAction: "hide",
maximized: true ,
닫을 수 있음: true,
bodyStyle: "padding:20px",
너비: 350,
높이: 300,
레이아웃: "form",
lableWidth: 110,
기본값: { xtype: "textfield", 너비: 180 },
items: [
{
fieldLabel: "Case Number",
anchor: "100%"
},
{
xtype: "datefield",
fieldLabel: "사고 시간",
anchor: "100%"
},
{
fieldLabel: "reporter",
anchor: "100%"
},
{
fieldLabel: "보고된 단위 또는 개인",
anchor: "100%"
},
{
xtype: "treecombo",
fieldLabel: "사건이 발생한 곳",
anchor: "100%",
url: "http://localhost:1502/treeData.ashx"/ //
},
{
xtype: "treecombo",
fieldLabel: "케이스 유형",
anchor: " 100%",
url: "http://localhost:1502/window/ajwflx.ashx"
},
{
xtype: "treecombo",
fieldLabel: " 특성 케이스",
앵커: "100%",
url: "http://localhost:1502/window/ajwfxz.ashx"
}
],
버튼: [{ text: "OK" }, { text: "Cancel", handler: function () { _window.hide() } }]
})
_window.show()
})
treedata.ashxd 내용은
string strTreeNode = "["
"{'id':150100,'leaf':false,expanded:false,'text':'후허하오터 토지자원국','children':[ "
"{'id':150101,'leaf':true,'children':null,'text':'지방 토지자원국'},"
"{'id':150102, ' leaf':true,'children':null,'text':'Xincheng District Land and Resources Bureau'},"
"{'id':150103,'leaf':true,'children':null, 'text':'후이민구 토지자원국'},"
"{'id':150104,'leaf':true,'children':null,'text':'위취안구 토지자원국' },"
"{'id':150105,'leaf':true,'children':null,'text':'사이한 지구 토지자원국'},"
"{'id': 150121,'leaf':true,'children':null,'text':'Tumut Left Banner 토지 자원국'},"
"{'id':150122,'leaf':true,'children' :null, 'text':'토케투오 카운티 토지자원국'},"
"{'id':150123,'leaf':true,'children':null,'text':'헬링거 카운티 토지자원 Bureau'},"
"{'id':150124,'leaf':true,'children':null,'text':'Qingshuihe County Land and Resources Bureau'},"
"{' id ':150125,'leaf':true,'children':null,'text':'우촨현 토지자원국'}"
"]},"
"{'id':150200,' leaf':false,expanded:false,'text':'바오터우시 토지자원국','children':["
"{'id':150201,'leaf':true,'children':null , 'text':'시 지구 토지자원국'},"
"{'id':150202,'leaf':true,'children':null,'text':'동허 지구 토지자원국 '} ,"
"{'id':150203,'leaf':true,'children':null,'text':'쿤둘룬 지구 토지자원국'},"
"{'id' : 150204,'leaf':true,'children':null,'text':'Qingshan District Land and Resources Bureau'},"
"{'id':150205,'leaf':true,'children' :null ,'text':'시과이 지구 토지자원국'},"
"{'id':150206,'leaf':true,'children':null,'text':'바이윈 광산 지구 토지 and Resources Bureau' },"
"{'id':150207,'leaf':true,'children':null,'text':'Jiuyuan District Land and Resources Bureau'},"
"{ 'id': 150221,'leaf':true,'children':null,'text':'Tumut Right Banner 토지 자원국'},"
"{'id':150222,'leaf':true ,'children':null,'text':'구양현 토지자원국'},"
"{'id':150223,'leaf':true,'children':null,'text':' Darkhan Maoming Anlian United Banner Land and Resources Bureau'}"
"]},"
"{'id':150300,'leaf':false,expanded:false,'text':'우하이 도시 토지 및 자원국' ,'children':["
"{'id':150301,'leaf':true,'children':null,'text':'지방 토지자원국'},"
"{' id':150302,'leaf':true,'children':null,'text':'Haibo Bay District Land and Resources Bureau'},"
"{'id':150303,'leaf ':true, 'children':null,'text':'하이난구 토지자원국'},"
"{'id':150304,'leaf':true,'children':null,'text ':'오다구 토지자원국'}"
"]},"
"{'id':150400,'leaf':false,expanded:false,'text':'츠펑시 토지 및 자원국','어린이':["
"{'id':150401,'leaf':true,'children':null,'text':'지방 토지자원국'},"
"{'id': 150402,'leaf':true,'children':null,'text':'홍산구 토지자원국'},"
"{'id':150403,'leaf' :true,'children':null ,'text':'Yuanbaoshan District Land and Resources Bureau'},"
"{'id':150404,'leaf':true,'children':null,'text' :'송산구 토지자원국'} ,"
"{'id':150421,'leaf':true,'children':null,'text':'Aruhorqin Banner Land and Resources Bureau'},"
"{'id': 150422,'leaf':true,'children':null,'text':'바레인 좌익 배너 토지 및 자원국'},"
"{'id':150423, 'leaf':true,'children': null,'text':'바레인 우익 토지자원국'},"
"{'id':150424,'leaf':true,'children':null ,'text':'린시현 토지자원국'},"
"{'id':150425,'leaf':true,'children':null,'text':'Keshiketeng Banner 토지자원국 '},"
"{ 'id':150426,'leaf':true,'children':null,'text':'Wengniute Banner 토지 자원국'},"
"{'id' :150428,'leaf':true ,'children':null,'text':'Haraqin Banner 토지 자원국'},"
"{'id':150429,'leaf':true,'children' :null,'text': '닝청 현 토지자원국'},"
"{'id':150430,'leaf':true,'children':null,'text':'Aohan Banner Land and 자원국'}"
"]},"
"{'id':150500,'leaf':false,expanded:false,'text':'퉁랴오시 토지자원국','children ':["
"{ 'id':150501,'leaf':true,'children':null,'text':'지방 토지자원국'},"
"{'id' :150502,'leaf':true,' children':null,'text':'Horqin District Land and Resources Bureau'},"
"{'id':150521,'leaf':true,'children' :null,'text':'Horqin 좌익 센터 배너 토지 및 자원국'},"
"{'id':150522,'leaf':true,'children':null,'text':'Horqin 좌익 허우 배너 토지 및 자원국'},"
"{'id':150523,'leaf':true,'children':null,'text':'Kailu County Land and Resources Bureau'}, "
"{'id':150524,'leaf': true,'children':null,'text':'Kulun Banner Land and Resources Bureau'},"
"{'id':150525, 'leaf':true,'children':null,'text':' Naiman Banner 토지자원국'},"
"{'id':150526,'leaf':true,'children':null, 'text':'Zalut Banner 토지 및 자원국'},"
" {'id':150581,'leaf':true,'children':null,'text':'Holingol City Land and Resources Bureau' }"
"]},"
"{'id ':150600,'leaf':false,expanded:false,'text':'오르도스 토지자원국','children':["
"{'id':150602,'leaf':true,' children':null,'text':'동성구 토지자원국'},"
"{'id':150621,'leaf ':true,'children':null,'text':'Dala 특별 배너 토지 자원국'},"
"{'id':150622,'leaf':true,'children':null,' text':'중가르 배너 토지자원국'},"
"{'id':150623,'leaf':true,'children':null,'text':'Otok Qian Banner 토지 자원국'},"
"{'id' : 150624,'leaf':true,'children':null,'text':'Otuoke Banner 토지 자원국'},"
"{'id':150625,'leaf':true,'children ': null,'text':'항진 배너 토지자원국'},"
"{'id':150626,'leaf':true,'children':null,'text':'우센 배너 토지자원국 '},"
"{'id':150627,'leaf':true,'children':null,'text':'에진홀로 배너 토지자원국'}"
"] },"
"{'id':150700,'leaf':false,expanded:false,'text':'후룬베이얼시 토지자원국','children':["
"{'id' :150701, 'leaf':true,'children':null,'text':'지방 토지자원국'},"
"{'id':150702,'leaf':true,'children': null, 'text':'하일라얼 지구 토지자원국'},"
"{'id':150721,'leaf':true,'children':null,'text':'Arong Banner 토지자원국' } ,"
"{'id':150722,'leaf':true,'children':null,'text':'모리다와 다우르 자치 배너 토지 자원국'},"
"{ 'id ':150723,'leaf':true,'children':null,'text':'오로켄 자치 깃발 토지 자원국'},"
"{'id':150724,'leaf':true, ' children':null,'text':'Ewenki 자치 깃발 토지 자원국'},"
"{'id':150725,'leaf':true,'children':null,'text':' Chen Barhu 배너 토지 및 자원국'},"
"{'id':150726,'leaf':true,'children':null,'text':'New Barhu Left Banner 토지 및 자원국'}, "
"{'id':150727,'leaf':true,'children':null,'text':'New Barhu Right Banner Land and Resources Bureau'},"
"{'id': 150781 ,'leaf':true,'children':null,'text':'Manzhouli 토지자원국'},"
"{'id':150782,'leaf':true,'children':null , 'text':'야케시시 토지자원국'},"
"{'id':150783,'leaf':true,'children':null,'text':'잘란툰시 토지자원자원국 '},"
"{'id':150784,'leaf':true,'children':null,'text':'에르군 시 토지자원국'},"
" {'id' :150785,'leaf':true,'children':null,'text':'겐허시 토지자원국'}"
"]},"
"{'id': 150800,'leaf ':false,expanded:false,'text':'Bayannur City Land and Resources Bureau','children':["
"{'id':150801,'leaf':true,' children':null, 'text':'시 지구 토지 자원국'},"
"{'id':150802,'leaf':true,'children':null,'text':'린허 지구 토지 자원 자원국 '},"
"{'id':150821,'leaf':true,'children':null,'text':'Wuyuan County Land and Resources Bureau'},"
"{' id' :150822,'leaf':true,'children':null,'text':'Dengkou 현 토지자원국'},"
"{'id':150823,'leaf':true,' children' :null,'text':'Urad Front Banner 토지 자원국'},"
"{'id':150824,'leaf':true,'children':null,'text':'Urad Tezhong Banner 토지자원국'},"
"{'id':150825,'leaf':true,'children':null,'text':'Uradhou Banner 토지자원국'},"
" {'id':150826,'leaf':true,'children':null,'text':'Hangjinhouqi 토지자원국'}"
"]},"
"{'id' :150900 ,'leaf':false,expanded:false,'text':'울란카브시 토지자원국','children':["
"{'id':150901,'leaf':true ,'children' :null,'text':'시 지구 토지자원국'},"
"{'id':150902,'leaf':true,'children':null,'text':'set Ning District Land and Resources Bureau'},"
"{'id':150921,'leaf':true,'children':null,'text':'Zhuozi County Land and Resources Bureau'},"
"{ 'id':150922,'leaf':true,'children':null,'text':'Huade County Land and Resources Bureau'},"
"{'id':150923,'leaf': true, 'children':null,'text':'Shangdu County Land and Resources Bureau'},"
"{'id':150924,'leaf':true,'children':null,'text':' Xinghe 현 토지자원국'},"
"{'id':150925,'leaf':true,'children':null,'text':'량청 현 토지자원국'},"
"{'id':150926,'leaf':true,'children':null,'text':'Chahar Right Front Banner 토지 자원국'},"
"{'id':150927, 'leaf ':true,'children':null,'text':'Chahar Right Middle Banner 토지 자원국'},"
"{'id':150928,'leaf':true,'children' :null, 'text':'차하르 오른쪽 배너 토지 및 자원국'},"
"{'id':150929,'leaf':true,'children':null,'text':'Siziwang Banner Bureau of Land and Resources'},"
"{'id':150981,'leaf':true,'children':null,'text':'Fengzhen 시 토지자원국'}"
"]} ,"
"{'id':152200,'leaf':false,expanded:false,'text':'싱안연맹 토지자원국','children':["
"{' id': 152201,'leaf':true,'children':null,'text':'Ulanhot Land and Resources Bureau'},"
"{'id':152202,'leaf':true,'children ':null ,'text':'Aershan City Land and Resources Bureau'},"
"{'id':152221,'leaf':true,'children':null,'text':'Horqin Right Front 배너 토지 및 자원국'},"
"{'id':152222,'leaf':true,'children':null,'text':'Horqin Right Wing Middle Banner Land and Resources Bureau'},"
"{' id':152223,'leaf':true,'children':null,'text':'Zhalaite Banner Land and Resources Bureau'},"
"{'id':152224,' leaf':true, 'children':null,'text':'투취안현 토지자원국'}"
"]},"
"{'id':152500,'leaf':false, 확장됨:false,' 텍스트':'시링골 연맹 토지자원국','어린이':["
"{'id':152501,'leaf':true,'children':null,'text': '이렌하오터시 토지자원국'},"
"{'id':152502,'leaf':true,'children':null,'text':'시린하오터시 토지자원국'},"
"{'id': 152522,'leaf':true,'children':null,'text':'아바가 배너 토지자원국'},"
"{'id':152523,'leaf ':true,'children' :null,'text':'Sunit Left Banner 토지 및 자원국'},"
"{'id':152524,'leaf':true,'children':null,'text':'Sunit Right Banner Land and Resources Bureau'},"
"{'id' : 152525,'leaf':true,'children':null,'text':'East Ujimqin Banner Land and Resources Bureau'},"
"{'id':152526,'leaf':true, 'children' :null,'text':'서우짐친 배너 토지 및 자원국'},"
"{'id':152527,'leaf':true,'children':null,'text' :'타이푸시 배너 랜드 and Resources Bureau'},"
"{'id':152528,'leaf':true,'children':null,'text':'Xianhuang Banner Land and Resources Bureau'},"
"{ 'id':152529,'leaf':true,'children':null,'text':'Zhengxiangbaiqi 토지자원국'},"
"{'id':152530,'leaf': true,' children':null,'text':'Zhenglan Banner Land and Resources Bureau'},"
"{'id':152531,'leaf':true,'children':null,'text': 'Duolun County 토지자원국'}"
"]},"
"{'id':152900,'leaf':false,expanded:false,'text':'알샤연맹 토지자원국 ', 'children':["
"{'id':152921,'leaf':true,'children':null,'text':'Alxa Left Banner Land and Resources Bureau'},"
"{ 'id':152922,'leaf':true,'children':null,'text':'Alxa 우익 토지자원국'},"
"{'id':152923,'leaf' : true,'children':null,'text':'Ejina Banner 토지 자원국'}"
"]}"
"]";
context.Response.Write(strTreeNode);
이렇게 하면 위에서 설명한 효과가 달성됩니다...

C 및 JavaScript는 WebAssembly를 통한 상호 운용성을 달성합니다. 1) C 코드는 WebAssembly 모듈로 컴파일되어 컴퓨팅 전력을 향상시키기 위해 JavaScript 환경에 도입됩니다. 2) 게임 개발에서 C는 물리 엔진 및 그래픽 렌더링을 처리하며 JavaScript는 게임 로직 및 사용자 인터페이스를 담당합니다.

JavaScript는 웹 사이트, 모바일 응용 프로그램, 데스크탑 응용 프로그램 및 서버 측 프로그래밍에서 널리 사용됩니다. 1) 웹 사이트 개발에서 JavaScript는 HTML 및 CSS와 함께 DOM을 운영하여 동적 효과를 달성하고 jQuery 및 React와 같은 프레임 워크를 지원합니다. 2) 반응 및 이온 성을 통해 JavaScript는 크로스 플랫폼 모바일 애플리케이션을 개발하는 데 사용됩니다. 3) 전자 프레임 워크를 사용하면 JavaScript가 데스크탑 애플리케이션을 구축 할 수 있습니다. 4) node.js는 JavaScript가 서버 측에서 실행되도록하고 동시 요청이 높은 높은 요청을 지원합니다.

Python은 데이터 과학 및 자동화에 더 적합한 반면 JavaScript는 프론트 엔드 및 풀 스택 개발에 더 적합합니다. 1. Python은 데이터 처리 및 모델링을 위해 Numpy 및 Pandas와 같은 라이브러리를 사용하여 데이터 과학 및 기계 학습에서 잘 수행됩니다. 2. 파이썬은 간결하고 자동화 및 스크립팅이 효율적입니다. 3. JavaScript는 프론트 엔드 개발에 없어서는 안될 것이며 동적 웹 페이지 및 단일 페이지 응용 프로그램을 구축하는 데 사용됩니다. 4. JavaScript는 Node.js를 통해 백엔드 개발에 역할을하며 전체 스택 개발을 지원합니다.

C와 C는 주로 통역사와 JIT 컴파일러를 구현하는 데 사용되는 JavaScript 엔진에서 중요한 역할을합니다. 1) C는 JavaScript 소스 코드를 구문 분석하고 추상 구문 트리를 생성하는 데 사용됩니다. 2) C는 바이트 코드 생성 및 실행을 담당합니다. 3) C는 JIT 컴파일러를 구현하고 런타임에 핫스팟 코드를 최적화하고 컴파일하며 JavaScript의 실행 효율을 크게 향상시킵니다.

실제 세계에서 JavaScript의 응용 프로그램에는 프론트 엔드 및 백엔드 개발이 포함됩니다. 1) DOM 운영 및 이벤트 처리와 관련된 TODO 목록 응용 프로그램을 구축하여 프론트 엔드 애플리케이션을 표시합니다. 2) Node.js를 통해 RESTFULAPI를 구축하고 Express를 통해 백엔드 응용 프로그램을 시연하십시오.

웹 개발에서 JavaScript의 주요 용도에는 클라이언트 상호 작용, 양식 검증 및 비동기 통신이 포함됩니다. 1) DOM 운영을 통한 동적 컨텐츠 업데이트 및 사용자 상호 작용; 2) 사용자가 사용자 경험을 향상시키기 위해 데이터를 제출하기 전에 클라이언트 확인이 수행됩니다. 3) 서버와의 진실한 통신은 Ajax 기술을 통해 달성됩니다.

보다 효율적인 코드를 작성하고 성능 병목 현상 및 최적화 전략을 이해하는 데 도움이되기 때문에 JavaScript 엔진이 내부적으로 작동하는 방식을 이해하는 것은 개발자에게 중요합니다. 1) 엔진의 워크 플로에는 구문 분석, 컴파일 및 실행; 2) 실행 프로세스 중에 엔진은 인라인 캐시 및 숨겨진 클래스와 같은 동적 최적화를 수행합니다. 3) 모범 사례에는 글로벌 변수를 피하고 루프 최적화, Const 및 Lets 사용 및 과도한 폐쇄 사용을 피하는 것이 포함됩니다.

Python은 부드러운 학습 곡선과 간결한 구문으로 초보자에게 더 적합합니다. JavaScript는 가파른 학습 곡선과 유연한 구문으로 프론트 엔드 개발에 적합합니다. 1. Python Syntax는 직관적이며 데이터 과학 및 백엔드 개발에 적합합니다. 2. JavaScript는 유연하며 프론트 엔드 및 서버 측 프로그래밍에서 널리 사용됩니다.


핫 AI 도구

Undresser.AI Undress
사실적인 누드 사진을 만들기 위한 AI 기반 앱

AI Clothes Remover
사진에서 옷을 제거하는 온라인 AI 도구입니다.

Undress AI Tool
무료로 이미지를 벗다

Clothoff.io
AI 옷 제거제

Video Face Swap
완전히 무료인 AI 얼굴 교환 도구를 사용하여 모든 비디오의 얼굴을 쉽게 바꾸세요!

인기 기사

뜨거운 도구

Atom Editor Mac 버전 다운로드
가장 인기 있는 오픈 소스 편집기

Dreamweaver Mac版
시각적 웹 개발 도구

PhpStorm 맥 버전
최신(2018.2.1) 전문 PHP 통합 개발 도구

mPDF
mPDF는 UTF-8로 인코딩된 HTML에서 PDF 파일을 생성할 수 있는 PHP 라이브러리입니다. 원저자인 Ian Back은 자신의 웹 사이트에서 "즉시" PDF 파일을 출력하고 다양한 언어를 처리하기 위해 mPDF를 작성했습니다. HTML2FPDF와 같은 원본 스크립트보다 유니코드 글꼴을 사용할 때 속도가 느리고 더 큰 파일을 생성하지만 CSS 스타일 등을 지원하고 많은 개선 사항이 있습니다. RTL(아랍어, 히브리어), CJK(중국어, 일본어, 한국어)를 포함한 거의 모든 언어를 지원합니다. 중첩된 블록 수준 요소(예: P, DIV)를 지원합니다.

에디트플러스 중국어 크랙 버전
작은 크기, 구문 강조, 코드 프롬프트 기능을 지원하지 않음
