extjs4

Should I add custom methods to Ext.data.store derived classes

一个人想着一个人 提交于 2019-12-13 06:25:01
问题 I'm totally new to sencha touch and extjs. Here is the scenario: Suppose you have this store that holds the items on a shopping cart: Ext.define('MyApp.store.CardItems', { extend: 'Ext.data.Store', requires: ['MyApp.model.CardItem','Ext.data.proxy.SessionStorage'], config :{ model: 'MyApp.model.QuoteItem', autoLoad: true, autoSync: true, identifer: 'uuid', proxy:{ type:'sessionstorage', id:'card' } } }); I know that in sencha a store is used to bind a list of model items to a grid for example

Browser History with ExtJS MVC

北慕城南 提交于 2019-12-13 06:23:58
问题 I am looking for an example of ExtJs MVC which supports browser history. The example they have on the Sencha site here is not MVC based. The other one I found here uses dynamically loaded views and controller. I imagine the solution is a combination of the 2 approaches. Wondering if anyone has a ready example that I can refer to? 回答1: I managed to put together an example by combining the approaches from the 2 links above. Here is the jsfiddle with the ext js script: http://jsfiddle.net

Is it possible to mix themes in ExtJS 4?

房东的猫 提交于 2019-12-13 06:14:33
问题 I want to have neptune toolbar on classic themed ExtJS website. Is this thing possible ? If so , How ? 回答1: You could create a custom theme derived from a classic theme and you could copy the toolbar styles to your custom theme folder. sencha generate theme my-custom-theme Then, on your project's config file found on project folder /.sencha/app/sencha.cfg , edit/add the following: app.theme=my-custom-theme #app.theme=ext-theme-classic I assume you have generated your project through Sencha

ExtJS 4.2 Month Days (columns) for Holiday Planner

我的未来我决定 提交于 2019-12-13 04:51:44
问题 I have a requirement for a 4.2.1 ExtJS app that Im building, to have a grid like the image below: The objective of the grid is to manage Holidays for employees. I was thinking in setting the columns of the grid dinamically , but will need to fill the background cell depending of the type of "leave type", and also disable some cells depending on the days that are not supposed to work (like weekends, etc). Any advice on how can I approach to the solution? Appreciate in advance. 回答1: There is a

extjs - How to submit a form when the response is not json?

末鹿安然 提交于 2019-12-13 04:35:24
问题 I understand that when I submit a form, according to the documentation ExtJs by default parses the response as JSON. In my case, the server returns HTML, that I want to display in a Panel. When I submit the from using getForm().submit() , ExtJs will throw an error about invalid JSON: Ext.JSON.decode(): You're trying to decode an invalid JSON String How can I tell ExtJs not to attempt to parse the response ? I could the access the text with the response object. 回答1: I don't know if you are

Unable to create ExtJS tree from json

拟墨画扇 提交于 2019-12-13 04:26:01
问题 I am trying to create a tree from json file. The JSON data is: [ { "root": { "text": "Root Node", "expanded": true, "children": [ { "text": "Invisible", "leaf": true, "children": [ { "text": "Bookmark 2", "leaf": true }, { "text": "Bookmark 3", "leaf": true } ] }, { "text": "Visible", "leaf": true, "children": [ { "text": "Bookmark 4", "leaf": true }, { "text": "Bookmark 5", "leaf": true } ] } ] } } ] Here is the code I am using for my store: Ext.define('DHT.store.Categories', { extend: 'Ext

How to share objects/methods between controllers without circular references?

空扰寡人 提交于 2019-12-13 04:19:26
问题 Pretty straightforward question. Currently, what I do when I need to access objects' methods throughout most of the application, I do this in app.js Ext.define('Utils', { statics: { myMethod: function() { return 'myResult'; } } }); This works, but when I build the application, I get a warning about a circular reference (app.js of course needs all the other controller classes, but then said classes refer back to app.js). I thought of using a package including a .js file that has all the

Ext.bind does not see function in ExtJS

寵の児 提交于 2019-12-13 02:59:11
问题 I am trying to mod the Portlet example and port it into our program. The code looks like this: Ext.create('Ext.container.Viewport',{ id: 'app-viewport', //creates viewport layout: { type: 'border', padding: '0 5 5 5' // pad the layout from the window edges }, onPortletClose: function(portlet) { this.showMsg('"' + portlet.title + '" was removed'); }, showMsg: function(msg) { var el = Ext.get('app-msg'), msgId = Ext.id(); this.msgId = msgId; el.update(msg).show(); Ext.defer(this.clearMsg, 3000,

Firing checkchange event on a tree node using its ID in ExtJs 4.1

自古美人都是妖i 提交于 2019-12-13 02:22:31
问题 I have a TreePanel. Each node in tree is given an ID. On click of a button, I want to fire the checkchange event for node 2.1 (as shown in the below tree). How can I fire checkchange event for a node using its ID on click of a button. 1 1.2 1.3 1.4 2 2.1 2.2 3 Thank you 回答1: To fire the checkchange you need to have the node and if it's checked. The TreePanel is using Ext.data.TreeStore to store it's nodes information (it is in the store property). This TreeStore has the getNodeById( id )

How to tell store what page was loaded

落花浮王杯 提交于 2019-12-13 02:02:13
问题 I have a store that is binded to grid. When it is loaded it has n pages. Now I want to show the page that contains certain value. In order to do that I use store.load({params: {'file': 'file33939'}}); (the 'file' is used because grid shows list of files, but it's irrelevant to question). At this moment I don't know what the page it should be. The response looks like: { "files":[{"id":"33939", "name": "file33939"}, /* ... */], "total": 1000, "page": 13 } Grid displays correct data (the page