本篇介绍了将数据动态绑定到Ext.form.ComboBox,以树状结构的形式显示.采取后台读数据库的方式.提供显示提示消息的效果和改变ComboBox的宽度和高度. 不支持手写和联想功能.

效果图如下:

ext2.2打造Ext.form.ComboBox系列--树形结构

前台代码如下:

 

代码
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="ComboBoxTree._Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    
<title></title>
    
<link href="extjs/resources/css/ext-all.css" rel="stylesheet" type="text/css" />

    
<script src="extjs/adapter/ext/ext-base.js" type="text/javascript"></script>

    
<script src="extjs/ext-all.js" type="text/javascript"></script>

</head>
<body>
    
<form id="form1" runat="server">
    
<div>
        
<div id="comboxtree">
        
</div>

        
<script type="text/javascript">
    function ready() {
        Ext.QuickTips.init();
        var comboTree 
= new Ext.form.ComboBox
        ({
            store: 
new Ext.data.SimpleStore({ fields: [], data: [[]] }),
            editable: 
false//禁止手写及联想功能
            mode: 'local',
            triggerAction: 
'all',
            frame: 
true,
            border: 
true,
            
//maxHeight: 300,width:200,
            tpl: '<div >

 源代码文件

相关文章:

  • 2022-12-23
  • 2021-09-15
  • 2022-03-11
  • 2022-12-23
  • 2021-11-07
  • 2021-06-04
  • 2021-12-05
  • 2021-12-31
猜你喜欢
  • 2021-09-18
  • 2021-10-17
  • 2021-06-22
  • 2021-12-20
  • 2022-02-25
  • 2022-01-01
  • 2022-12-23
相关资源
相似解决方案