extjs3

ExtJS (JavaScript) Module Design Pattern best practices

倾然丶 夕夏残阳落幕 提交于 2019-11-29 12:21:17
问题 I have a question about best practices with the Module Design Pattern. The code below is an example of the way that some of our Components are written (we use ExtJs but that shouldn't matter too much). We build a lot of our components like this and I know that this doesn't match best practices exactly. Have any thoughts to clean up the code? Ext.ns("TEAM.COMPONENT"); function Foo() { // Private vars var privateNumber=0, myButton, privateInternalObject; var numberField = new Ext.form

File download a byte array as a file in javascript / Extjs

二次信任 提交于 2019-11-29 03:34:31
问题 In my Ext Js solution I am calling a service which is returning this JSON format {"success":true,"filename":"spreadsheet.xlsx","file":[80,75,3,4,20,0,...(many more)]} How can I make a file download dialog with the filename and the content of the byte array (file) ? UPDATE So I found this bit to start the downlaod var a = window.document.createElement('a'); a.href = window.URL.createObjectURL(new Blob(data.file, { type: 'application/octet-stream' })); a.download = data.filename; // Append

How to add an empty item to ExtJS combobox?

你说的曾经没有我的故事 提交于 2019-11-29 03:12:41
I want to add and empty item (display value is blank, item height is kept as normal) to an Ext.form.ComboBox. I refered 2 links below to configure my combobox, but it still not display the empty item: http://www.ashlux.com/wordpress/2009/09/04/handling-empty-options-with-ext-js-combo-box/ http://www.sencha.com/forum/showthread.php?52340-How-to-add-a-quot-blank-quot-entry-to-a-ComboBox Here is my code: this.abcCombo = new Ext.form.ComboBox({ name : 'abcCombo', hiddenName : 'abcCombo-id', fieldLabel : "My Combobox", width : 250, editable : false, forceSelection : true, mode : 'local',

Adding CSV upload browse button to Ext.Action

烂漫一生 提交于 2019-11-28 10:42:35
问题 I am trying to create a CSV File upload on GeoExt Map App. I need to place the upload function within the Ext.Action, so that I can add it to the toolbar of the GeoExt Panel. I am trying to implement this example. Here is my code, action = new Ext.Action({ text: "Upload Excel", control: Ext.create('Ext.form.Panel', { title: 'Upload a CSV File', width: 400, bodyPadding: 10, frame: true, renderTo: Ext.getBody(), items: [{ xtype: 'filefield', name: 'csv', fieldLabel: 'CSV Upload', labelWidth: 50

How to add an empty item to ExtJS combobox?

痞子三分冷 提交于 2019-11-27 17:43:26
问题 I want to add and empty item (display value is blank, item height is kept as normal) to an Ext.form.ComboBox. I refered 2 links below to configure my combobox, but it still not display the empty item: http://www.ashlux.com/wordpress/2009/09/04/handling-empty-options-with-ext-js-combo-box/ http://www.sencha.com/forum/showthread.php?52340-How-to-add-a-quot-blank-quot-entry-to-a-ComboBox Here is my code: this.abcCombo = new Ext.form.ComboBox({ name : 'abcCombo', hiddenName : 'abcCombo-id',

how to show/ hide column in a extjs 3 grid panel

扶醉桌前 提交于 2019-11-27 03:21:48
问题 I have a grid panel i need to show / hide columns in a grid panel depending on the value of a checkbox. If the checkbox is checked i need to display column in the grid and if it is unchecked i need to hide the column in the grid. Here is my code var chkEnableDisplayResponsibilityForAction = '<%=Session["chkEnableDisplayResponsibilityForAction"]%>'; var flags = Boolean.parse(chkEnableDisplayResponsibilityForAction); var flags1 = !Boolean.parse(chkEnableDisplayResponsibilityForAction) var