How to add Display Text on Ext.Img in extjs4.1.3? - extjs

I am trying to add a display text on Ext.Img....
But their is no such functionality mentioned in sencha docs.
Anybody have some solution for the same.... ?
new Ext.Img({
src: "images/blue_arrow.png",
id:'demoImgCmp',
title:'Demo Display Text',
text:'Demo Display Text',
html:'<b>Demo Display Text</b>'
})
above code is not working for me....

Related

Buidling a custom horz bar chart in superset and adding a custom item to customize chart

I have no react, typscript or d3 experience prior to this.
I am trying to build a horizontal bar chart where I can customize the colours of the bar depending on the value of the bar
I have gotten this far. See this chart:
I need to change the conditional formatting customization so the color is not entered from a drop down and is a text area where I can enter the hex code.
This is what I need to change and the condiditional formating I am talking about. It is on the table chart:
I have traced it back to the following code in controlPanel.tsx
{
label: t('Options'),
expanded: true,
controlSetRows: [
[
{
name: 'conditional_formatting',
config: {
type: 'ConditionalFormattingControl',
renderTrigger: true,
label: t('Conditional formatting'),
description: t(
'Apply conditional color formatting to numeric columns',
The actual pop up where you enter the field and color you want to associate the colour appears to be in
/superset/superset-frontend/src/explore/components/controls/ConditionalFormatingcontrol folder. So what I was hoping to do was to copy that, make my changes and call it. However I have no idea how I need to compile it and no idea how to call it
My guess was I could change the type below to the name of the copy of the component I created if I had compiled things correctly
name: 'conditional_formatting',
config: {
type: 'ConditionalFormattingControl',
Can anyone help me?
The available chart customization controls for a chart in superset set appear to be located in
/superset/superset-frontend/src/expore/components/controls
The list of chart customization controls exported that are available for list is in
/superset/superset-frontend/src/expore/components/controls/index.js
To customize one or to create a new component for customizing a custom chart in superset copy put in the directory listed above that you have copied and changed from the directory above or created and change the index.js file so that it is exported for use

Change text update cancel buttons grid in sencha architect (ext js)

Just as the title says, is there any way to change the text (or languaje) of the update and cancel buttons while editing a grid?
Thanks,
Edit:
I already changed the text inside RowEditor.js
saveBtnText: 'Update',
to
saveBtnText: 'Example',
but doesn't work
You can override the Ext.grid.RowEditor class like so:
Ext.define(null, {
override: 'Ext.grid.RowEditor',
saveBtnText: 'Salveaza',
cancelBtnText: 'Anuleaza'
});
Here is the working fiddle: https://fiddle.sencha.com/#view/editor&fiddle/27uj.
Assuming that you want to localize your entire application, you should take a looke at this guide from sencha. Basically, you just require the ext-locale package in your app.json
"requires": [
"ext-locale"
]
After this, you should set the locale param (also in app.json) to the desired language:
"locale": "es"
Doing this, you will get all ExtJS components localized.

Upload file in extjs

I have to upload a file using browse dialogue. Please help me.. Then what will have to write inside handler()?
Ext.create('Ext.ux.tab.Toolbar', {
width: 120,
id:'document-inner-right-tabs',
items: [{
id:'resumeUpButton',
tooltip:'Upload',
disabled:true,
handler:function(){}
}]
});
Anyone to help me?
Just use the fileuploadfield object as described here in the docs. It consists of a field and a button, when clicking the button it will open a file browsing window to allow selection.
If you want, there is also a config to hide the field so it is only a button, you could then save the file location in a variable or something.

How to display Ext.List data in TabPanel?

I am very new in Sencha Touch 2. I am trying to develop a simple screen with Tab Panel. In the panel, there will be three tabs- artist, albums and playlist. So when i will click the artist, it should show me the list of artist names. This artist name i am keeping in one store file. I wrote the code for view, store and model. But is it require to write the code code for container also? Because i am getting a empty list with 3 rows.
Here is senchafiddle link for my app: Sencha fiddle link
Please help me. As i am pretty new in Sencha Touch 2.
Thanks in advance.
Please note that Javascript is case-sensitive.
It seems that you want to name your field firstName. So take a look at your model definition and simply change it to:
Ext.define('MyApp.model.modelname', {
extend: 'Ext.data.Model',
config: {
fields: [
{
name: 'firstName' //it's 'firstname' before
}
]
}
});

how to enable button in extjs?

I am new to ExtJs(using EXT js 4 ), I am trying out simple code.
I have a submit button which is set disabled by default
buttons: [{
text: 'Submit',
id:'submit',
disabled:true
}]
I want to enable the button based on certain conditon.Something like
if (validation_status== "success") {
//Enable the submit button
//Ext.get('submit').dom.disabled = false; -- Not working
//Ext.get('submit').enable(); -- Not working
}
I tried above 2 option. Which did not worked for me.
Can anyone help me out?
Use this:
Ext.getCmp('submit').enable();
When you use Ext.getCmp(), it gives you the component which has a number of component methods to use. If you use Ext.get(), it gives you the element with a number of dom element modification functions. So, its always better to test in firebug console for any of these to know what methods are there.
console.log(Ext.getCmp('submit'));
console.log(Ext.get('submit'));

Resources