extjs

ExtJS4 API文档阅读(三)——布局和容器

和自甴很熟 提交于 2019-12-20 20:47:00
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> ExtJS4 API文档阅读(三)——布局和容器 ExtJS4.0布局和容器(Layouts and Containers)是Ext JS中最强大的部分之一。它负责控制你应用程序中每个组件的尺寸和定位。本文内容包括了如何运用布局的基础。 一、容器 一个Ext JS应用程序的图形用户界面(UI)是由许多组件(查看组件指南( Components Guide )获取更多关于组件的信息)构成的。容器是一种可以容纳一些其他组件的特殊类型组件。 典型的Ext JS应用程序是由一些嵌套的组件构成不同的层来组成的。如下图: 最通用的容器就是 Panel 。让我们看下如何创建一个容器以允许一个Panel包含其他的组件: Ext.create('Ext.panel.Panel', { renderTo: Ext.getBody(), width: 400, height: 300, title: 'Container Panel', items: [ { xtype: 'panel', title: 'Child Panel 1', height: 100, width: '75%' }, { xtype: 'panel', title: 'Child Panel 2', height: 100, width: '75%' }

Extjs - How to show combobox in Grid column

白昼怎懂夜的黑 提交于 2019-12-20 17:32:30
问题 I have a gridpanel include date and combo column jsfiddle But I don't want click to show my combo. I want show my combo without click, not hide inside cell like and the same for date column like I think chage to clicksToEdit: 0 but fail plugins: [ Ext.create('Ext.grid.plugin.CellEditing', { clicksToEdit: 1 }) ] How to do that, thanks 回答1: The only way to achieve this in 4.2x or below is to use a custom component like Skirtle's comonent column http://skirtlesden.com/ux/component-column This

Overriding Extjs classes and invoking callParent

谁都会走 提交于 2019-12-20 11:49:49
问题 I have a few months of experience developing Extjs web application. I ran into this problem: When I override a class, I modified the method and followed the previous implementation and invoke callParent() . The overriding part works but the callParent() invoked the old implementation. my overriding code Ext.override(Ext.layout.component.Draw, { finishedLayout: function (ownerContext) { console.log("new layouter being overriden"); this.callParent(arguments); } }); The Extjs class method to be

How to add event listeners to an array of objects

混江龙づ霸主 提交于 2019-12-20 11:40:12
问题 I have an array of objects (specifically easelJS images) - something like this: var imageArray = new Array; gShape = new createjs.Shape(); // shape is something imageArray.push(gShape); What I want to do is have an event listener instead of: gShape.addEventListener("click", function() {alert"stuff"}); I want the program to know specifically which region is clicked so that I can send an alert box in the following way: imageArray[index].addEventListener("click", function(){ alert " you clicked

ExtJs best practices

淺唱寂寞╮ 提交于 2019-12-20 11:34:08
问题 it seems that most ExtJS books and ExtJS introductions just focus on showing all the nice features but most of them don't really explain how to build stable, maintainable layouts / applications with ExtJS. And how to write them without creating an unreadable mess... I've no specific application in mind, I'm just wondering how I can "beatify" my ExtJS code. So if you need an example, a "regular" application for item management (library) or something like a job board would best describe what I

504 Gateway Time-out The server didn't respond in time. How to fix it?

让人想犯罪 __ 提交于 2019-12-20 10:09:34
问题 The client requested to download a compressed log file, using Ext.js a form submission on an embedded iframe . Request was sent to server, which has Apache and JBoss 6. The servlet compresses log files, do some database operation and returns the compressed file. Exactly after 2 min, the 504 Gateway Time-out The server didn't respond in time message is seen at the browser net panel. How to fix this error? 回答1: The servlet was taking a long time to compress the log files, and Apache's timeout

ExtJS: Login with 'Remember me' functionality

柔情痞子 提交于 2019-12-20 09:47:14
问题 I'm trying to create a simple login window with the very common 'Remember me' functionality. The login validation is done AJAX style, thus the browser won't remember my input. My approach is to use the built-in state functionality, but how to use it confuses me. Ext.state.Manager.setProvider(new Ext.state.CookieProvider({ expires: new Date(new Date().getTime()+(1000*60*60*24*7)), //7 days from now })); ... { xtype: 'textfield', fieldLabel: 'User name', id: 'txt-username', stateful: true,

ExtJs4 + IE9 = Object doesn't support property or method 'createContextualFragment'

左心房为你撑大大i 提交于 2019-12-20 09:39:57
问题 I'm working with ExtJs on IE9.. and i almost always get this error.. Microsoft JScript runtime error: Object doesn't support property or method 'createContextualFragment' What dose it means? What 'createContextualFragment' is needed for? And how to fix this? 回答1: createContextualFragment() is a method of Range objects that creates a document fragment from an HTML string. It's present in Firefox and WebKit and Opera but is currently non-standard (it's not in the DOM Level 2 Range spec but is

How can I replace the content of a panel with new content?

强颜欢笑 提交于 2019-12-20 09:38:30
问题 I have a regionContent panel which I add to my viewport. How can I replace its content with new content? ... var regionContent = new Ext.Panel({ id: 'contentArea', region: 'center', padding:'10', autoScroll: true, html: 'this is the original content' }); var viewport = new Ext.Viewport({ layout: 'border', items: [ regionMenu, regionContent ] }); var newPanel = new Ext.Panel({ region: 'east', title: 'Info Panel', width: 300, html: 'this is a panel that is added' }); // regionContent.update

extjs - how correctly call a controller method from another controller or closure

喜欢而已 提交于 2019-12-20 09:32:03
问题 I'm new to extjs and I'm using the MVC architecture. When my application references a method of a controller, I do it that way (in MyApp.Application ): Mb.app.getController('Main').myMethod(); It is already long, but I think this is the way to do. When a controller calls it's own method in a closure, I was led to use this code (in MyApp.controller.Main : controllerMethodOne: function(){ Ext.Ajax.request({ url: ..., params: ..., success: (function(response){ list = Ext.JSON.decode(response