将表格升级为可编辑电影信息的Ext.grid.EditorGridPanel

需积分: 48 27 下载量 89 浏览量 更新于2024-08-08 收藏 5.53MB PDF 举报
该资源主要讨论了如何将一个基本的表格升级为可编辑的电影数据库,使用了Ext JS框架。这段代码展示了如何创建一个可编辑的表格,允许用户修改电影的标题、导演和标语。 在JavaScript和Ext JS的背景下,这个示例中提到的四个关键步骤是将表格变为可编辑的`EditorGridPanel`: 1. **表格定义的转换**:首先,将原本的`Ext.grid.GridPanel`替换为`Ext.grid.EditorGridPanel`。`EditorGridPanel`是Ext JS中用于创建可编辑数据网格的类,它允许用户直接在表格单元格内编辑数据。 2. **创建编辑字段**:创建了三个`Ext.form.TextField`对象,分别对应于电影的标题(`title_edit`)、导演(`director_edit`)和标语(`tagline_edit`)。`director_edit`设置了`vtype: 'name'`,这可能是一个自定义验证类型,确保输入的数据符合特定规则。 3. **配置编辑网格**:创建`EditorGridPanel`时,指定了多个属性,如渲染位置(`renderTo: document.body`)、边框(`frame: true`)、标题(`title: 'Movie Database'`)、高度和宽度,以及单击编辑(`clickstoEdit: 1`),这意味着只需单击单元格即可开始编辑。 4. **定义列和编辑器**:`columns`数组定义了每个列的属性,包括标题、数据索引和编辑器。例如,标题列使用`title_edit`作为编辑器,导演列使用`director_edit`,标语列使用`tagline_edit`,并限制了标语的最大长度为45个字符。 此外,资源还提到了Ext JS框架的基础知识,它是构建富互联网应用程序(RIA)的强大工具,提供了一系列的控件和API,可以创建类似桌面应用的用户体验。Ext JS基于雅虎YUI库,但提供了更多的功能和组件。尽管1.x和2.x版本之间存在较大差异,但3.x版本开始增强了向后兼容性,方便开发者结合使用。适配器功能使得Ext JS可以与其他JavaScript库共存,扩展其功能。通过使用AJAX技术,Ext JS实现了动态数据加载和更新,提高了用户界面的交互性。示例中特别提到了FeedViewer和SimpleTask,这两个示例展示了Ext JS的多种特性和功能。
2017-01-26 上传
Master the art of advanced VoIP and WebRTC communication with the most dynamic application server, FreeSWITCH About This Book Forget the hassle - make FreeSWITCH work for you Discover how FreeSWITCH integrates with a range of tools and APIs From high availability to IVR development use this book to become more confident with this useful communication software Who This Book Is For SysAdmins, VoIP engineers – whoever you are, whatever you’re trying to do, this book will help you get more from FreeSWITCH. What You Will Learn Get to grips with the core concepts of FreeSWITCH Learn FreeSWITCH high availability Work with SIP profiles, gateways, ITSPs, and Codecs optimization Implement effective security on your projects Master audio manipulation and recording Discover how FreeSWITCH works alongside WebRTC Build your own complex IVR and PBX applications Connect directly to PSTN/TDM Create your own FreeSWITCH module Trace SIP packets with the help of best open source tools Implement Homer Sipcapture to troubleshoot and debug all your platform traffic In Detail FreeSWITCH is one of the best tools around if you’re looking for a modern method of managing communication protocols through a range of different media. From real-time browser communication with the WebRTC API to implementing VoIP (voice over internet protocol), with FreeSWITCH you’re in full control of your projects. This book shows you how to unlock its full potential – more than just a tutorial, it’s packed with plenty of tips and tricks to make it work for you. Written by members of the team who actually helped build FreeSWITCH, it will guide you through some of the newest features of version 1.6 including video transcoding and conferencing. Find out how FreeSWITCH interacts with other tools and APIs, learn how to tackle common (and not so common) challenges ranging from high availability to IVR development and programming advanced PBXs. Great communication functionality begins with FreeSWITCH – find out how and get your project up and running today. Style and approach Find out how it works, then put your knowledge into practice - that's how this advanced FreeSWITCH guide has been designed to help you learn. You'll soon master FreeSWITCH and be confident using it in your projects. Table of Contents Chapter 1: Typical Voice Uses for FreeSWITCH Chapter 2: Deploying FreeSWITCH Chapter 3: ITSP and Voice Codecs Optimization Chapter 4: VoIP Security Chapter 5: Audio File and Streaming Formats, Music on Hold, Recording Calls Chapter 6: PSTN and TDM Chapter 7: WebRTC and Mod_Verto Chapter 8: Audio and Video Conferencing Chapter 9: Faxing and T38 Chapter 10: Advanced IVR with Lua Chapter 11: Write Your FreeSWITCH Module in C Chapter 12: Tracing and Debugging VoIP Chapter 13: Homer, Monitoring and Troubleshooting your Communication Platform