⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 forum-search.js

📁 着重用css实现页面显示功能,实现简单数据库连接,是很好的入门教程
💻 JS
字号:
/*
 * Ext JS Library 1.1.1
 * Copyright(c) 2006-2007, Ext JS, LLC.
 * licensing@extjs.com
 * 
 * http://www.extjs.com/license
 */

Ext.onReady(function(){    var ds = new Ext.data.Store({        proxy: new Ext.data.ScriptTagProxy({            url: 'http://extjs.com/forum/topics-remote.php'        }),        reader: new Ext.data.JsonReader({            root: 'topics',            totalProperty: 'totalCount',            id: 'post_id'        }, [            {name: 'title', mapping: 'topic_title'},            {name: 'topicId', mapping: 'topic_id'},            {name: 'author', mapping: 'author'},            {name: 'lastPost', mapping: 'post_time', type: 'date', dateFormat: 'timestamp'},            {name: 'excerpt', mapping: 'post_text'}        ])    });    // Custom rendering Template    var resultTpl = new Ext.Template(        '<div class="search-item">',            '<h3><span>{lastPost:date("M j, Y")}<br />by {author}</span>{title}</h3>',            '{excerpt}',        '</div>'    );        var search = new Ext.form.ComboBox({        store: ds,        displayField:'title',        typeAhead: false,        loadingText: 'Searching...',        width: 570,        pageSize:10,        hideTrigger:true,        tpl: resultTpl,        onSelect: function(record){ // override default onSelect to do redirect            window.location =                String.format('http://extjs.com/forum/showthread.php?t={0}&p={1}', record.data.topicId, record.id);        }    });    // apply it to the exsting input element    search.applyTo('search');});

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -