extjs4

Is there a way to only show parent nodes in a extjs tree

主宰稳场 提交于 2019-12-13 20:27:41
问题 I want to show only parent nodes of a tree in extjs. In my datastore there are leaf nodes as well. The output should be like - Folder 1 Folder 1.1 Folder 2 Folder 3 回答1: Create a filter object that gets only parent nodes and add it to the store config: E.g. filter for parent nodes only: var nodeFilter = new Ext.util.Filter({ property: 'leaf', value : false }); Putting it on the treestore config: var yourTreeStore = Ext.create('Ext.data.TreeStore', { // other configs ... filters: [nodeFilter]

Extjs 4 remote filter store smaller (<) bigger (>) than

非 Y 不嫁゛ 提交于 2019-12-13 19:40:26
问题 Is it possible to remote filter smaller than and bigger than? I know how to handle this in php and mysql but I don't know how to set such a filter in a extjs 4 store. 回答1: Out of the box with 4.1, no. You will need to overwrite the responsible provider proxy for that cause currently only property-value pairs get submitted (responsible function). The other point is that the Ext.util.Filter don't support any comparator for remotesort at all. So you have to implement your own and ensure that the

ExtJS 5 - Download file from POST servlet request

北战南征 提交于 2019-12-13 19:22:51
问题 I have trying to implement the export functionality in ExtJS 5 using form submit method. And I had look at the following stackoverflow link, it helps but not fully. Extjs 4 (with a code for 3.4 below) downloading a file returned from a post request In my case i facing an issue after the request response is successful, getting invalid JSON encoding error.Even i tried to change the reader from JSON reader to some other string reader(mentioned in link), but it is quite successful for some reason

Custom function call after Extjs 4 grid sort

岁酱吖の 提交于 2019-12-13 18:22:01
问题 I have an Extjs 4 grid with sort capability. i want to call a custum function after each time user presses sort button. In my custom function i want to navigate to the first page of my grid (my grid uses pagination and it takes advantage of server-side sort) i think i must use store.loadPage(1) in my custom function (correct me if I'm wrong) where should i put my custom function? This is my Ext.OnReady() function: Ext.onReady(function() { Ext.tip.QuickTipManager.init(); var url = { local:

how to call a listener of view from controller in Extjs

ⅰ亾dé卋堺 提交于 2019-12-13 18:15:42
问题 i have a bar chart in my view where i have a listener which is retrieving the bar column items ,now i have to call that listener from controller here is my code ... This is the listener in my view.. listeners: { itemmousedown: function (obj) { alert(obj.storeItem.data['source'] + ' &' + obj.storeItem.data['count']); } }, and i have to call this listener from my controller.here is my code.. init: function () { this.control({ 'barColumnChart': { //this is the id of the bar chart in my View

charts won't draw with extjs 3.4

柔情痞子 提交于 2019-12-13 18:07:10
问题 A simple problem, really simple code, i just copy/paste the code example, on my local project of course, but no charts drawing ... i really don't understand what's happening, i change in doubt url of the swf on my local folder, same problem, please help ! <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Charts v1.0</title> <link rel="stylesheet" type="text/css" href="css/ext-all.css" rel="stylesheet" /> <script type="text/javascript" src="js/ext-base

Extjs4, How to set displayField in combo editor?

徘徊边缘 提交于 2019-12-13 14:18:21
问题 In combo editor, after select a option, it display value even I set display Field. Once I click the combo editor, it will display displayField as well, but after select and click the others (It means mouse out) then the cell value changed to valueField. my combo editor code, { xtype : 'combo', editable : false, triggerAction : 'all', displayField : 'name', valueField : 'id', store : myStore } what I missed? anyone know, please advice me~ Thanks! [Edit] I write test code in here : http:/

ExtJS alias vs id

天涯浪子 提交于 2019-12-13 13:49:55
问题 I don't understand the usage of alias vs id vs itemId config properties in ExtJS app/view/foo.js Ext.define('app.view.foo', { ... alias: 'widget.foo', // 1 id: 'foo', // or 2 ... }); app/controller/goo.js Ext.define('app.controller.goo', { ... views: ['foo', ...], init: function() { this.control({ 'foo': {...}, // 1 '#foo': {...} // or 2 ... }); ... }, ... }); With alias I can use xtype easily.. but what advantage do I gain by setting id 's to my views? 回答1: An alias is set on the class

Render customize component inside XTemplate

白昼怎懂夜的黑 提交于 2019-12-13 12:23:01
问题 Ext.define('GB.view.DigestList',{ extend: 'Ext.panel.Panel', alias:'widget.digestlist', items:[ { xtype:'dataview', store: 'GB.store.Digests', tpl: new Ext.XTemplate( '<tpl for=".">', '<div class="container">', '{name}', '<div class="davidfun"></div>', '</div>', '</tpl>' ), listeners: { viewready: function(){ var home_d = Ext.create('GB.view.MyOwnDigest'); home_d.render(Ext.query('.davidfun')[0]); // home_d.render(Ext.getBody()); <- it'll work fine with this line }, } }], bind: function

ExtJs:How to get Session variable

烂漫一生 提交于 2019-12-13 08:56:06
问题 In my Java web application,when a user gets logged in,i store the user name and other details in session as follows, session.setAttribute("userName",username); I am using ExtJs4 for UI. How to get the session variables in extJs? Thanks 回答1: I can second @Geronimo approach. You need to get user Id and/or permissions when you authenticate the user. However... You can't rely just on the username/permissions that you store somewhere in your JS code because it can't be easily spoofed. If you