extjs4.1

extjs4 global network exception listener

好久不见. 提交于 2019-12-05 20:01:59
I want to write a listener that will listen to all network requests errors, something like this : Ext.Ajax.on('requestexception', function(conn, response, options) { if (response.status === 555) { Ext.Msg.alert('test', 'test'); } }); The above code works only for requests via Ext.Ajax.request() , how to rewrite it so it could work also for form submits, url not found error etc. On server side I have Spring MVC that dispatches all requests and if there is any error , the response status of 555 is returned. form.submit({ url: dispatcher.getUrl('savePlanRequest'), //headers: {'Content-Type':

extjs parsing nested json in template

≯℡__Kan透↙ 提交于 2019-12-05 09:04:00
Trying (unsuccessfully) to display data from nested json. JSON might look something like: { "contacts": [ { "id": "1", "client_id": "135468714603", "addresses": [ { "id": "1", "contact_id": "1", "address_id": "16", "address": { "0": { "id": "16", "address": "123 Some Rd", "address2": "", "city": "Toen", "state": "VS", "zip_code": "11111", "country": "USA" } } }, { "id": "6", "contact_id": "1", "address_id": "26", "address": { "0": { "id": "26", "address": "1 Other Road", "address2": "", "city": "Twn", "state": "BD", "zip_code": "11112", "country": "USA" } } } ] }, { "id": "10", "client_id":

how to get array of objects from store in extjs 4.2 and send it to server side?

↘锁芯ラ 提交于 2019-12-05 03:43:01
问题 Hiii all, I am using Extjs 4.2 data grid and i have a requirement to convert my 'store' into json array and send that to server side(i.e java). This is my model. Ext.define('Writer.Document',{ extend: 'Ext.data.Model', fields: ['id', 'name', 'notes', 'Type', 'date'] }); and my store (which contains list of objects) is var store = Ext.create('Ext.data.Store', { model: 'Writer.Document', autoLoad: true, proxy: { type: 'ajax', url : 'findPatientRecordAction', reader: { type: 'json',

ExtJs - Get element by div class?

烈酒焚心 提交于 2019-12-05 03:30:43
How do I get the ExtJs component object of a Div by class name? Say my div is: <div class="abc"></div> How do I get the ExtJs object of this Div to perform e.g. getWidth() Note: There is no id given. What I tried: Ext.select(".abc") Ext.query(".abc") Edit: Error: Object has no method 'getWidth' <div id="main"> <div class="abc"></div> </div> var d = Ext.get( "main" ); d.query('.abc').getWidth(); Use var dom = Ext.dom.Query.select('.abc'); var el = Ext.get(dom[0]); This will return an Ext.Element . You can then use ext methods on el like so el.on('click', function(){}, scope); or el.getWidth() I

how to filter a extjs store with an exact match

你说的曾经没有我的故事 提交于 2019-12-05 01:59:09
问题 I am using a filter for a store. The problem is that I want to return an exact match. For example: If I am filtering for aa-1 in a grid it will show aa-1 and aa-1*** but if I want only see everything with aa-1 . I use this to filter: listeners: { itemclick: function() { var data = grid.getSelectionModel().selected.items[0].data; store.clearFilter(); store.filter('productsCat', data.productsCat); } } What do I have to do to do an exact match? 回答1: You could use a regular expression in the

ExtJs grid.Panel store: keep scrollbar position after load/reload

空扰寡人 提交于 2019-12-05 00:32:06
I'm using grid.Panel in Sencha ExtJs 4.0.2a and I reload a Json Store every 60 seconds. I was wondering if there is a way to preserve the position of the scrollbar after a data load. So that the user can continue to look at the records he was looking before the load.. I reload the data in the grid using a Task: var task = { run: function(){ Ext.getCmp(panelGridId).getStore().load({ //Callback function after loaded records callback: function(records) { //Hide grid if empty records if (Ext.isEmpty(records)) { Ext.getCmp(panelGridId).setVisible(false); } else { if (Ext.getCmp(panelGridId)

Render customize component inside XTemplate

纵饮孤独 提交于 2019-12-04 19:28:50
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(record, store) { this.getComponent(0).bindStore(record); } }); Ext.define('GB.store.Digests', { extend:'Ext

How to export grid data to excel along group headers/ summary records with expand and collapse action in Excel?

喜欢而已 提交于 2019-12-04 19:00:45
I have done application using Extjs 4. I have requirement need to export grid data to excel. I have grid it contains many records, showing records by group headers/summary(collapse/Expand actions ). The same thing i need to export grid data to excel the same activity need collapse/expand in excel sheet . I have tried i am able to export grid records with group headers.summary to excel, cool it is working but collapse/expand is not happening in excel sheet. I need to implement this feature by writing a code. Can anybody tell me how to achieve this one? is it possible or not by using extjs?

Extjs File upload using json service?

一世执手 提交于 2019-12-04 18:41:09
I am using json service(.net RIA service) to push data to server from Extjs. Currently I have a requirement to upload document to server. I saw some examples using form submit to php files. Is this possible through json service? or Is it necessery to create some server logic where i can accept form submits? Is it possible to read some binary data from client side and push as json data to server? In Extjs, File uploads are not performed using normal 'Ajax' techniques, that is they are not performed using XMLHttpRequests. Instead a hidden element containing all the fields is created temporarily

extjs 4.1 page scrolls to top of grid in internet explorer on row update

醉酒当歌 提交于 2019-12-04 17:07:24
On my grid i'm using rowediting. if using Internet explorer 10 ( probably the other versions too ) and the page has scrollbars When i edit a row and click "update" the page scrolls up to the start of the grid. This issue is quite well documented on ( though not specifically on 4.1 ). I've seen fixed that override rowModel like this Ext.override(Ext.selection.RowModel, { onRowMouseDown: function(view, record, item, index, e) { // view.el.focus(); this.selectWithEvent(record, e); } }); I've also seen adding the following to the grid. selModel: Ext.create('Ext.selection.Model', { listeners: {} })