extjs4

ExtJS 4.1 How to create a window with grid dynamically

☆樱花仙子☆ 提交于 2019-12-12 13:50:36
问题 I'm a new ExtJS user and I've a question. I have a store with cars and I create a menu with buttons to see all cars by brand or model. Now I want to display a window with a grid panel containing all my cars for a particular brand/model. Actually when I create my buttons i do that : var aCarButton = Ext.create('Ext.Button', { text: aTextButton, handler: function() { var aResultWindow = new ResultWindow(aTextButton, myCarStore, 'Brand', aBrandValue); aResultWindow.create(); } }); aMenuPanel.add

How to Extend/Override a predefined core sencha class?

ぃ、小莉子 提交于 2019-12-12 13:43:44
问题 I need to apply some changes into extjs 4.x core library to supports right-to-left direction in rendering.i already know its not good to manipulate the ExtJS code directly. My question is: How to do this via another js file that loaded into page after the ext-all.js ? its possible to change a predefined sencha class method by calling Ext.apply() ? 回答1: It really depends what exactly you need to modify. But I believe you meant the following. I have a file called ext-mods.js , which is loaded

ExtJs 4 Combobox missing config option hiddenName

断了今生、忘了曾经 提交于 2019-12-12 13:41:13
问题 I'm trying to create an ExtJs version 4 ComboBox that will post the valueField and not the displayValue. Prior version would be to set the 'hiddenName' option in the config of ComboBox, but I can't seem to find it in v 4 or something equivalent. Also, this is NOT in an ExtJs form panel. The combobox is being rendered inside a plain html form //My Code new Ext.form.ComboBox({ renderTo: 'my_div', store: new Ext.data.SimpleStore({ fields: ['value', 'name'], data: [['1', 'A'], ['2', 'B'], ['3',

autoHeight issue in ExtJS4

こ雲淡風輕ζ 提交于 2019-12-12 12:20:31
问题 We are using autoHeight to window in ExtJS3. But now in ExtJS4 it is not working. Is there any alternative to this one? If yes,please let me know. 回答1: Read this and this, maybe it helps 回答2: dont set the height property then it should automatically get height depending on content it works for me,hope it will for u 来源: https://stackoverflow.com/questions/6758298/autoheight-issue-in-extjs4

Downloading multiple files into a Zip file Javascript using data URI

拥有回忆 提交于 2019-12-12 11:34:42
问题 I am using EXT JS 4.2 which has a panel which contains a export to CSV button. On clicking on it multiple (total six) files are downloaded. I want these files to be downloaded in a single ZIP file. 回答1: There is a perfect plugin to create zip files inside browser. JSZip: https://stuk.github.io/jszip/ Install the plugin by adding js files manually: download JSZip and include the file dist/jszip.js or dist/jszip.min.js JSFiddle - JSZip 3.0: https://jsfiddle.net/andrebonna/u8zsbzau/ var zip =

Loading data from a json file into extjs

左心房为你撑大大i 提交于 2019-12-12 11:28:35
问题 I have a .json file whose content is supposed to be read by Ext.data.Store and displayed by Ext.grid.Panel (extjs 4). However, no data is displayed, only the grid is. The code is: var user = Ext.create('Ext.data.Store', { storeId: 'user', model: 'User', autoLoad: 'true', proxy: { type: 'ajax', url : '/users.json', reader: {type: 'json', root: 'blah'} } }); Ext.create('Ext.grid.Panel',{ store :user, id : 'user', title: 'Users', columns : [ {header: 'ID', dataIndex : 'id'}, {header : 'NAME',

Why does ExtJS subtract a day when formatting a date?

陌路散爱 提交于 2019-12-12 10:53:25
问题 Using ExtJS 4.0.2 , I can type the following into the console: Ext.util.Format.date('2012-01-13', "m-d-Y"); I get 01-12-2012 Why? I can correct it with: Ext.util.Format.date('2012-01-13 00:00:00', "m-d-Y"); 回答1: Ext.util.Format.date in Ext 4.0.2 uses a Date object or a String (your case). This string is parsed using the native Date.parse() using the UTC time zone. Try to explicitly parse it using Ext.Date.parse: var dt = Ext.Date.parse("2012-01-13", "Y-m-d"); Ext.util.Format.date(dt, "m-d-Y")

Ext deployed application: ext.js vs ext-all.js - what's a better option?

一世执手 提交于 2019-12-12 10:07:46
问题 Looking at the deploy process for an ExtJS 4 application I performed the following steps (using SDK Tools 2.0.0-beta3): sencha create jsb -a http://localhost:8080/myapp/ -p app.jsb3 sencha build -p app.jsb3 -d . This created for me all-classes.js and app-all.js . The next step was to switch form ext-all.js to ext.js . Doing that my app stop working. Looking at the console, I noticed that Ext tried to load the required classes separately, from a src folder. src/AbstractPlugin.js?_dc

pdf download dialog window not appear in browser. extjs 4 with java

喜欢而已 提交于 2019-12-12 09:24:42
问题 I am able to generate a report in pdf form using JasperReports and Java. The generated report is not available to be downloaded to the client side. I am generating pdf file using the code below: public void getTaskreportPDF(Session openSession,HttpServletRequest request,HttpServletResponse response) { try { Class.forName("com.mysql.jdbc.Driver"); Connection con = (Connection) DriverManager.getConnection("jdbc:mysql://localhost/contact","root","root"); Map params = getParameters(openSession);

ExtJS Model Validations: Dates (How to)

安稳与你 提交于 2019-12-12 09:19:59
问题 What's the best way to go about adding validation to a date field in a model Ext.define('User', { extend: 'Ext.data.Model', fields: [ {name: 'name', type: 'string'}, {name: 'age', type: 'int'}, {name: 'phone', type: 'string'}, {name: 'gender', type: 'string'}, {name: 'username', type: 'string'}, {name: 'alive', type: 'boolean', defaultValue: true} ], validations: [ {type: 'presence', field: 'age'}, {type: 'length', field: 'name', min: 2}, {type: 'inclusion', field: 'gender', list: ['Male',