extjs

Accept Image in Filefield ExtJs

久未见 提交于 2019-12-24 01:50:19
问题 I have a filefield componente in my application and I want to restrict it to only image files. I've found this question on stackoverflow: How to restrict file type using xtype filefield(extjs 4.1.0)? Add accept="image/*" attribute to input field in ExtJs I'm using this code: { xtype:'filefield', listeners:{ afterrender:function(cmp){ cmp.fileInputEl.set({ accept:'audio/*' }); } } } But this code only works the first time I click on "Examine" button, when I click again on it, the restriction

Extjs ComboBox doesn't pick the correct value when setValue is called

这一生的挚爱 提交于 2019-12-24 01:44:12
问题 I have the following code: // Part of a larger form. { xtype: 'combo', id: 'enroller', valueNotFoundText: 'not found', triggerAction: 'all', mode: 'local', fieldLabel: 'Enroller', store: new Ext.data.JsonStore({ url: url, root: 'data', autoLoad: true, fields: ['enrollerID', 'name', 'key'] }), displayField: 'name', valueField: 'key', hiddenName: 'enrollerID', forceSelection: true } // Other area of code. Ext.getCmp('enroller').setValue(289); Even though I can confirm the store has a record

how to show pdf file in ext.window?

一笑奈何 提交于 2019-12-24 01:24:27
问题 It doesn't work, what is wrong? var win = new Ext.Window({ title: 'PDF Content', width: 400, height: 600, maximizable: true, layout: 'fit', plain: true, items: { // Let's put an empty grid in just to illustrate fit layout xtype: 'component', autoEl: { tag: "iframe", src: "../../../resources/august2013.pdf" } } //items : [ { // html: '<object width="100%" height="100%" data="../../../resources/august2013.pdf"></object>' //} ] }) win.show(); This view I am getting after inserting code below

select row only when checkbox is clicked ExtjS 4

南笙酒味 提交于 2019-12-24 00:46:10
问题 In an ExtJS 4.1 grid that uses CheckboxModel as a selection model, when you click on an entire row, that row is selected (and the corresponding checkbox is checked). Is there a way that I can prevent that default behaviour from happening and permit row selection only when the checkbox for a corresponding row is clicked (as opposed to when clicking the entire row)? Again I'm using ExtJS version 4.1 Thanks for any help Note: My grid also has the CellEditing plugin attached to it. I don't want

How to get an ExtJS ComboBox to display inline with text?

倾然丶 夕夏残阳落幕 提交于 2019-12-24 00:41:20
问题 I want to get the following to display in a single line. I have tried using styles float and display. Show this input <input type="text" name="filterOp" id="filterOp"/> inline. <script type="text/javascript"> new Ext.form.ComboBox({ applyTo: 'filterOp', triggerAction: 'all', name: 'item', mode: 'local', lazyInit: true, displayField: 'name', valueField: 'id', forceSelection: true, typeAhead: true, inputType:'text', fieldLabel: 'Item selection', style: "display: inline-block", store: new Ext

Recursive tree menu structure in Ext JS 4.1

余生长醉 提交于 2019-12-24 00:36:08
问题 First of all, Im new at ExtJS. I wanted your help to let me know the best way to obtain a tree menu with n recursive items in it. In example: FOLDER ..FOLDER ....ITEM ....FOLDER ......ITEM ......ITEM ....FOLDER ... Im following the best practises proposed by Sencha. I was able to do a tree menu with one level, but when trying to do it for n levels, it fails (in fact, the app works but shows infinite nodes of 1st level). Clearly the issue is the model definition of my menu item, see: Ext

On an ExtJS drag and drop tree using the drop or beforedrop listeners dont seem to fire

末鹿安然 提交于 2019-12-24 00:14:25
问题 I have a tree in extjs. I've added the drag and drop plugin and those function fine in the browser but I need to send the dragged and drop change to my DB correct? To do this I believe I should listen for the drop event then make an ajax call to my back end. I have a checkchange event that fires OK but a drop or beforedrop even seem to do nothing. Here is my tree's config, what am I doing wrong? todotree = { title: 'Tree Grid', width: 600, height: 400, viewConfig: { plugins: { ptype:

Extjs 4 upload success function does not react

非 Y 不嫁゛ 提交于 2019-12-24 00:14:02
问题 i have a grid with an toolbar and on that toolbar an upload option is added, so the upload is alright and it works , but after the file was uploaded to the server the success function does not react. here my upload code: upload: function () { Ext.create('Ext.window.Window', { title: 'Upload', width: 300, layout: 'fit', draggable: false, resizable: false, modal: true, bodyPadding: 5, items: [{ xtype: 'form', bodyPadding: 10, frame: true, items: [{ xtype:'filefield', name:'file', fieldLabel:

How do I stop a clicked combo box from clearing its value?

守給你的承諾、 提交于 2019-12-23 23:19:59
问题 I'm trying to edit a combobox value. But what happens is when I click a grid cell the old value disappears I want to keep a the and also avoid the user to select the values form the combo box itself and not values other than those in the drop down How can i achieve these two things. { text: 'Food Items', xtype: 'gridcolumn', dataIndex: 'food_lister', flex: 1, renderer: function (value) { console.log() if (Ext.isNumber(value)) { var store = this.getEditor().getStore(); return store.findRecord(

How to create a select field in Sencha Touch like the iPhone ringtone screen

混江龙づ霸主 提交于 2019-12-23 23:07:55
问题 I am developing an app using Sencha Touch 1.1.1. I would like to create an item on a form similar to the iPhone ringtone field (see image). Currently I'm using a textfield and when it gets focus I'm changing the card to a list. The only problem with this is the on-screen keyboard is displayed. How can I create a form field like the Ringtone field in the iOS sound configuration? 回答1: I have a solution for now. I created a new class - ListField - based on the code for the Selectfield. I would