extjs4

Is it possible to use an xtype inside an ExtJS template

て烟熏妆下的殇ゞ 提交于 2019-12-13 00:45:14
问题 I am wondering if I can do something like this in ExtJS. I am creating my own button as an xtype and want it to be used in the table row I am creating. testTpl: Ext.DomHelper.createTemplate( { tag: 'tbody', children: [ { tag: 'tr', cls: 'test-row', children:[{ tag: 'td', cls: 'test-table-cell test-class1', html: '{value1}' }, { tag: 'td', xtype:'myxtype' cls: 'test-table-cell test-class2', html: '{value2}' }] }] }); 回答1: Its not possible to place ExtJS components inside of a extjs template.

ExtJs 4: Component with Ext.ux.upload plugin has stopped working after rewriting in MVC style

隐身守侯 提交于 2019-12-13 00:22:46
问题 I've had working button with upload plugin. When my application has grown, I've rewritten this button in MVC way (just removed Ext.create, renderTo and added Ext.define) and it stopped working. Button is shown but has no plugin action (os window with file selection, etc.). Could you advice me something please? Here is working part of code in simple "one file" style: ObjectPhotosTab = Ext.create('Ext.Panel', { id : 'ObjectPhotosTab', items : [ Ext.create('Ext.ux.upload.Button', { text :

ExtJs 4, what is the right way to Delete control from container and Remove it from the memory?

纵饮孤独 提交于 2019-12-12 19:18:55
问题 The question is simple but i can't find a good and clear answer for it. What is the right way to: Delete control from container Remove it from the memory, in ExtJs 4? 回答1: Ext.AbstractContainer.remove method can't be far off. remove( Component/String component, [Boolean autoDestroy]) : Void Removes a component from this container. Fires the beforeremove event before removing, then fires the remove event after the component has been removed. Parameters component : Component/String The

Extjs4 autocomplete of combobox issue

為{幸葍}努か 提交于 2019-12-12 17:28:15
问题 I am working in extjs+php on auto complete of combobox property.i have view as- Ext.define('Balaee.view.kp.Word.Word', { extend:'Ext.form.Panel', id:'WordId', alias:'widget.Word', title:'Dictionary', items:[ { xtype : 'combobox', fieldLabel : 'Enter the word', name : 'wordtext', displayField: 'word', valueField: 'word', allowBlank : false, emptyText : 'Enter the word', enableKeyEvents : true, autoSelect: true, id : 'wordtext', triggerAction:'all', typeAhead:true, typeAheadDelay:100, mode:

How to scroll to a specified record in a grid

梦想与她 提交于 2019-12-12 16:24:44
问题 How can we scroll to a defined record (record or index) in a grid? Using a buffered renderer this is quite easy by calling: grid.view.bufferedRenderer.scrollTo(0, false, callback, scope); but how can this be done with a default renderer? 回答1: Try grid.getView().scrollRowIntoView(rowIndex) 来源: https://stackoverflow.com/questions/23421508/how-to-scroll-to-a-specified-record-in-a-grid

Change background color of row extjs4

本小妞迷上赌 提交于 2019-12-12 16:07:51
问题 I have a grid named 'grid' and onload there are rows being insert into the grid. Some Rows will be in green will be successfully input rows while rows with a background color of red will have errors. I had it working at some point but the error rows would be added to the grid w their background color red. Then when i tried to add a new row to enter new data into that all the rows went white. And then that stopped working all together. I've tried store.insert(0, r).addClass('error-row'); and

Extjs custom vtype

空扰寡人 提交于 2019-12-12 15:22:43
问题 im trying validate a textfield with a custom vtype to filter white spaces, ex: " ". I defined my custom vtype in the app.js (im using mvc pattern). Ext.Loader.setConfig({ enabled : true, paths: { Ext: 'vendor/ext41/src', My: 'app' } }); Ext.apply(Ext.form.field.VTypes, { descartarBlanco: function(value) { return /^\s+$/.test(value); } }); Ext.application({ name: 'CRUDManantiales', appFolder: 'app', controllers: ['Ui','Usuarios'], .... }); But, Firebug show this error: TypeError: vtypes[vtype]

Switch from textfield to displayfield with ExtJS4

狂风中的少年 提交于 2019-12-12 15:08:44
问题 I have created a form that displays values in plain displayfields. There is an "edit" button next to the form and once clicked by the user, the displayfields should switch to being textfields and will, therefore, make the data editable. This, I am guessing, would be achieved by having two identical forms, one editable and one not and one or the other would be visible, based on the user having clicked the button. Another way, perhaps, is to have the xtype dynamically selected upon clicking the

Uncaught Ext.Error: You're trying to decode an invalid JSON String: Form Submission using Ext JS and Spring MVC

耗尽温柔 提交于 2019-12-12 15:06:42
问题 I am getting the following error after submitting my Ext JS form: Uncaught Ext.Error: You're trying to decode an invalid JSON String JS: Ext.onReady(function() { var simple = Ext.create('Ext.form.Panel', { frame : true, title : 'Login Form', bodyStyle : 'padding:5px 5px 0', width : 350, fieldDefaults : { msgTarget : 'side', labelWidth : 75 }, defaultType : 'textfield', defaults : { anchor : '100%' }, items : [{ fieldLabel : 'User Name', name : 'userName', allowBlank : false, emptyText :

Extjs4 set tooltip on each column hover in gridPanel

本小妞迷上赌 提交于 2019-12-12 13:59:10
问题 I am getting tooltip on mouse hover by each row for current column but I am unable to get next column tooltip on continue hover on same row. But I can get it if I hover on another row & again hover any column of the previous row by using: listeners:{ 'itemmouseenter': function (view, record, item, index, e, eOpts) { var gridColums = view.getGridColumns(); var column = gridColums[e.getTarget(this.view.cellSelector).cellIndex]; Ext.fly(item).set({ 'data-qtip': 'Des:' + column.dataIndex }); } }