extjs

extjs4 catching the scroll event on panel

余生颓废 提交于 2019-12-24 03:04:48
问题 I have a tabpanel with chats on different tabs. Each tab panel has a chat and the discussions are sometime very long so, in my initComponent , I have a code to continuously scroll to bottom so I can show the latest messages: setInterval -> this.scrollBy 100000, 100000 , 100 which works fine for what it's supposed to do. The problem is that I sometimes want to see what I talked earlier and I have to scroll to top but this code obviously wouldn't let me. I implemented a hook: setInterval -> if

Difference between column and hBox layout

余生颓废 提交于 2019-12-24 02:50:35
问题 As far as I can tell, the hBox layout in extJS seems kind of redundant. This layout would make the first element 25%, and the second 75% layout: { type: 'hbox' align : 'stretch', pack : 'start', }, items: [ {html:'a', flex:1}, {html:'b', flex:3} ] But I could just as easily do this with a column layout like so : layout:'column', items: [ {html: 'a', columnWidth: .25}, {html: 'b',columnWidth: .75} ] What is the purpose of the hbox layout? 回答1: The hbox layout have more configs. but the column

Why would PHP-generated Javascript not work in file loaded via AJAX?

有些话、适合烂在心里 提交于 2019-12-24 02:50:12
问题 I am loading a .php file via an ExtJS AJAX call like this: menuItemApplication.header.on('click', function() { Ext.Ajax.request({ url: 'content/view_application.php', success: function(objServerResponse) { var responseText = objServerResponse.responseText; regionContent.update(responseText); var scripts, scriptsFinder=/<script[^>]*>([\s\S]+)<\/script>/gi; while(scripts=scriptsFinder.exec(responseText)) { eval(scripts[1]); } } }); }); Javascript in the loaded .php file executes fine: <script

ExtJS: Getting response of Proxy post in local variable

此生再无相见时 提交于 2019-12-24 02:42:48
问题 I am new to ExtJS so please excuse if this is very basic. I googled but couldn't find any useful answer. I have a Store with proxy type AJAX: tableStore = Ext.create('Ext.data.Store', { model: 'TableData', pageSize: 20, proxy: { type: 'ajax', url: url } }); The call to url returns a JSON object. I want to get this JSON object in some local variable to do some processing. Is this possible? Thanks. 回答1: You can refer to the data obtained in the method transform: Ext.define('MyModel', { extend:

Recursive Ajax Upon Success

可紊 提交于 2019-12-24 02:33:18
问题 I'm trying to make an ajax request recursively upon each success response that is returned from each request Would I be prone to stack overflows? If so do you have any better way of doing this? My requirements is to initially perform an ajax request and if the json returned is not done perform another ajax request with the same parameters... etc until i get a done flag. go: function (r) { Ext.Ajax.request({ url: 'bleh', success: function (response) { var data = Ext.decode(response

how do i prevent an extjs model/proxy from saving the empty primary id on create

我的未来我决定 提交于 2019-12-24 02:23:49
问题 i have defined my model with a REST proxy. it works fine for read (GET) and update (PUT) because those operations require a primary id. when i perform a create operation (POST) the proxy sends all the fields, including the empty primary id, to the server, which causes and error on the server. the server expects that no primary id is to be included for a create operation. how do i instruct extjs to not send the empty primary id value? ie. "{ 'model_id':'',...}"? Ext.define('model', { extend :

Reconfiguring grid columns in ExtJs4 - SelModel disappears?

北城余情 提交于 2019-12-24 02:18:14
问题 I am defining a grid which has a selModel . Each time the store loads, the grids columns are dynamically reconfigured using the grids Reconfigure method. However when I do this the grids selModel disappears. How can I reconfigure the grids columns to also include the selModel. Below is some example code: //The Selection Model for the grid. var sm = new Ext.selection.CheckboxModel(); //The Grid var grid = new Ext.grid.Panel({ store: store, selModel: sm, columns:[{ header: 'Loading ...' }] });

AJAX Webmethod call returns 404 on MVC3

时光总嘲笑我的痴心妄想 提交于 2019-12-24 02:07:52
问题 I've been using EXTJS 4 and loading my stores through an AJAX call to a Webmethod on the codebehind of an .aspx page. This method has worked for all of my projects until I tried porting my EXTJS 4 work into a MVC3 project. My calls are now returning 404. The key part is that the project (and the EXTJS4 webmethod calls) works on my colleagues' machines - only my machine is affected by this '404' error. Any Webmethod call, be it one of theirs or written by me, returns as 'Resource Not Found'.

ExtJS Grid Row Specific EmptyText?

白昼怎懂夜的黑 提交于 2019-12-24 01:53:57
问题 Our application uses the Ext.grid.Panel to display rows of data. When the user clicks a "New..." button we are adding a new record to the grid store. Everything is working fine. However, on certain fields, of just this new (as of yet) unsynced records, we would like to display specific empty text within certain cells. For example: 'Enter title here' or 'Choose a platform". I know there is an emptyCellText property on Column, but a) its broken, and b) I'd like to have this happen only on new,

PageSize not working on Grid in ExtJS

元气小坏坏 提交于 2019-12-24 01:53:09
问题 I want to limit the records per page to a specific number apply paging in the grid but its failing due to some reason. Can anyone say why it's failing, or not working? Here's the Fiddle. My Store var myStore=Ext.create('Ext.data.Store', { storeId: 'simpsonsStore', fields: ['busname', 'time', 'typebus',], pageSize:2, data: [{ busname: 'ABCD', time: '15:30:00', typebus: 'AC Volvo', }, { busname: 'aaa', time: '13:30:00', typebus: 'Seater', },{ busname: 'AAAA', time: '18:30:00', typebus: 'Sleeper