Translucent tab bar in Sencha Touch 2 - ios7

I was wondering what is the best way to make the tab bar translucent (iOS7 style) and have the content scroll underneath it. I am using a tab panel. Thoughts?
I tried setting tab bar to floating:true, but:
1. tabBar seems to be intended for private use and couldn't find floating property on it
2. On doing the following on the tab panel:
tabBar: {
floating: true
},
tabBarPosition: 'bottom'
I'm just getting the tab bar to be docked on top. Thoughts?
Thanks!

As of right now, you can't achieve translucence with CSS and dynamic content underneath. If it was a static image, you could do it.
You can approximate the effect with transparency. You basically need to use a container as your tab bar and style it with "position: absolute;" and set bottom: 0. The tab bar container shouldn't be an item of the list, rather an item of a container which also has the list.
Here's a quick example: https://fiddle.sencha.com/#fiddle/26i
Ext.application({
name : 'Fiddle',
launch : function() {
var toolbar = {
xtype: 'container',
bottom: 0,
alias: 'bottomtoolbar',
layout: 'hbox',
items: [
{
xtype: 'button',
text: 'Option 1',
style: 'background: transparent;',
iconAlign: 'top',
width: 80,
height: 60,
margin: '0 10 0 10'
},
{
xtype: 'button',
text: 'Option 2',
style: 'background: transparent;',
iconAlign: 'top',
width: 80,
height: 60,
margin: '0 10 0 10'
},
{
xtype: 'button',
text: 'Option 3',
style: 'background: transparent;',
iconAlign: 'top',
width: 80,
height: 60,
margin: '0 10 0 10'
}
],
width: '100%',
height: 80,
style: 'position: absolute; background: rgba(255,255,255,0.9);'
};
var list = {
xtype: 'list',
itemTpl: '{title}',
items: [
{
// Spacer so end of list is selectable
xtype: 'container',
height: 80,
scrollDock: 'bottom'
}
],
data: [
{ title: 'Item 1' },
{ title: 'Item 2' },
{ title: 'Item 3' },
{ title: 'Item 1' },
{ title: 'Item 2' },
{ title: 'Item 3' },
{ title: 'Item 1' },
{ title: 'Item 2' },
{ title: 'Item 3' },
{ title: 'Item 1' },
{ title: 'Item 2' },
{ title: 'Item 3' },
{ title: 'Item 1' },
{ title: 'Item 2' },
{ title: 'Item 3' },
{ title: 'Item 1' },
{ title: 'Item 2' },
{ title: 'Item 3' },
{ title: 'Item 1' },
{ title: 'Item 2' },
{ title: 'Item 3' },
{ title: 'Item 1' },
{ title: 'Item 2' },
{ title: 'Item 3' },
{ title: 'Item 1' },
{ title: 'Item 2' },
{ title: 'Item 3' },
{ title: 'Item 1' },
{ title: 'Item 2' },
{ title: 'Item 3' },
{ title: 'Item 2' },
{ title: 'Item 3' },
{ title: 'Item 1' },
{ title: 'Item 2' },
{ title: 'Item 3' },
{ title: 'Item 2' },
{ title: 'Item 3' },
{ title: 'Item 1' },
{ title: 'Item 2' },
{ title: 'Item 3' },
{ title: 'Item 4' }
]
};
Ext.Viewport.add(toolbar);
Ext.Viewport.add(list);
}
});
Granted, it's not styled very well, but you get the idea. Hope that helps.

Tabbar is docked by default to the bottom of the screen so even if you make it translucent all the content will be above it you will be unable to achieve what you wish. Instead you can set a bottom for the tab bar to position it below then add some opacity like .75 or .8 to try & get what you want

Related

sencha touch RadioGroup not working

Does RadioGroup works properly in sencha touch ?
Example :
var myRadioGroup = new Ext.form.RadioGroup({
id: 'myGroup',
xtype: 'radiogroup',
fieldLabel: 'Single Column',
// Arrange radio buttons into three columns, distributed vertically
columns: 3,
vertical: true,
items: [
{boxLabel: 'Item 1', name: 'rb', inputValue: '1'},
{boxLabel: 'Item 2', name: 'rb', inputValue: '2', checked: true},
{boxLabel: 'Item 3', name: 'rb', inputValue: '3'},
{boxLabel: 'Item 4', name: 'rb', inputValue: '4'},
{boxLabel: 'Item 5', name: 'rb', inputValue: '5'},
{boxLabel: 'Item 6', name: 'rb', inputValue: '6'}
]
});
var resultsPanel = Ext.create('Ext.Panel', {
title: 'Results',
style:"margin:50px 0 0 10px;",
layout: {
type: 'vbox', // Arrange child items vertically
align: 'stretch',//, // Each takes up full width
padding: 55
},
defaults: {
labelWidth: '85%',
labelWrap: true,
labelAlign: 'right'
},
items:[{
xtype: 'radiogroup',
fieldLabel: 'RadioGroup',
items:myRadioGroup
}]
});
Ext.viewport.add(resultsPanel);
This generates the following error :
[ERR] C2008: Requirement had no matching files (Ext.form.RadioGroup) -- C:\xampp\htdocs\testRadio\app.js:17:30.
Does anyone have an idea ,i tried updating app.json (not working ) ,also i searched for RadioGroup.js in touch/src/form/ but did not find it .
Sencha don't have radio group field , It has radio field only.
refer this. http://docs-origin.sencha.com/touch/2.4/2.4.1-apidocs/#!/api/Ext.field.Radio
for implementing Radio group give same name to all radio field:
ex:
var form = Ext.create('Ext.form.Panel', {
fullscreen: true,
items: [
{
xtype: 'radiofield',
name : 'color',
value: 'red',
label: 'Red',
checked: true
},
{
xtype: 'radiofield',
name : 'color',
value: 'green',
label: 'Green'
},
{
xtype: 'radiofield',
name : 'color',
value: 'blue',
label: 'Blue'
}
]
});

Extjs checkboxfield not rendering in Apache Tomcat

We are using tomcat 6.0.36 and trying to do simple check box example but check boxes are not rendered rest everything working fine
All the text rendered properly, i have created some pages with tabs, forms and grids all pages rendering except checkboxes in them.
Ext.onReady(function() {
Ext.QuickTips.init();
var fsf = Ext.create('Ext.form.Panel', {
url:'save-form.php',
frame:true,
title: 'Simple Form with FieldSets',
bodyStyle:'padding:5px 5px 0',
width: 350,
fieldDefaults: {
msgTarget: 'side',
labelWidth: 75
},
defaults: {
anchor: '100%'
},
items: [{
xtype:'fieldset',
checkboxToggle:true,
title: 'User Information',
defaultType: 'textfield',
collapsed: true,
layout: 'anchor',
defaults: {
anchor: '100%'
},
items :[{
fieldLabel: 'First Name',
name: 'first',
allowBlank:false
},{
fieldLabel: 'Last Name',
name: 'last'
},{
fieldLabel: 'Company',
name: 'company'
}, {
fieldLabel: 'Email',
name: 'email',
vtype:'email'
}]
},{
xtype:'fieldset',
title: 'Phone Number',
collapsible: true,
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items :[{
fieldLabel: 'Home',
name: 'home',
value: '(888) 555-1212'
},{
fieldLabel: 'Business',
name: 'business'
},{
fieldLabel: 'Mobile',
name: 'mobile'
},{
fieldLabel: 'Fax',
name: 'fax'
}]
}],
buttons: [{
text: 'Save'
},{
text: 'Cancel'
}],
renderTo: 'build-dynaForm'
})
});
Thanks in advance
Raj
On your form no checkboxes. If you add them, they will be displayed:
{
fieldLabel: 'Checkbox',
xtype: 'checkbox',
name: 'name1'
},{
fieldLabel: 'Checkbox',
xtype: 'checkbox',
name: 'name2'
},{
fieldLabel: 'Checkbox',
xtype: 'checkbox',
name: 'name3'
}
See http://jsfiddle.net/3FBzM/

Sencha Ext JS4.. [Grid ActionColumn] doesn't display

I'm new with sencha js 4. I already followed the instruction from the sencha documentation guide regarding with how to use actioncolumn, but it doesn't display on my grid.
"Where did I miss?. is there anything that I skipped? or is there anything that I didn't included? help.."
I use the kitchenSink sample that sencha provided me. I tried to manipulate it and added an actioncolumn from one of the grids in the kitchenSink sample
Here is my code:
Ext.define('PayrollLite.view.GridExample', {
extend: 'Ext.grid.Panel',
frame: true,
width: 1200,
height: 750,
store: 'Employees',
columns:
[
{ text: 'Employee Code', width: '10%', dataIndex: 'EmployeeCode' },
{ text: 'Last Name', width: '22%', dataIndex: 'LastName'},
{ text: 'First Name', width: '25%', dataIndex: 'FirstName' },
{ text: 'Middle Name', width: '15%', dataIndex: 'MiddleName' },
{ text: 'Position', width: '15%', dataIndex: 'PositionID', sortable: false },
{
xtype:'actioncolumn',
width:50,
items: [{
icon: 'extjs/examples/shared/icons/fam/cog_edit.png', // Use a URL in the icon config
tooltip: 'Edit',
handler: function(grid, rowIndex, colIndex) {
var rec = grid.getStore().getAt(rowIndex);
alert("Edit " + rec.get('firstname'));
}
},{
icon: 'extjs/examples/restful/images/delete.png',
tooltip: 'Delete',
handler: function(grid, rowIndex, colIndex) {
var rec = grid.getStore().getAt(rowIndex);
alert("Terminate " + rec.get('firstname'));
}
}]
}
]
});
My best guess would be the widths - try setting the other columns to flex widths instead. Like so:
Ext.define('PayrollLite.view.GridExample', {
extend: 'Ext.grid.Panel',
frame: true,
width: 1200,
height: 750,
store: 'Employees',
columns:
[
{ text: 'Employee Code', flex: '1', dataIndex: 'EmployeeCode' },
{ text: 'Last Name', flex: '2.2', dataIndex: 'LastName'},
{ text: 'First Name', flex: '2.5', dataIndex: 'FirstName' },
{ text: 'Middle Name', flex: '1.5', dataIndex: 'MiddleName' },
{ text: 'Position', flex: '1.5', dataIndex: 'PositionID', sortable: false },
{
xtype:'actioncolumn',
width:50,
items: [{
icon: 'extjs/examples/shared/icons/fam/cog_edit.png', // Use a URL in the icon config
tooltip: 'Edit',
handler: function(grid, rowIndex, colIndex) {
var rec = grid.getStore().getAt(rowIndex);
alert("Edit " + rec.get('firstname'));
}
},{
icon: 'extjs/examples/restful/images/delete.png',
tooltip: 'Delete',
handler: function(grid, rowIndex, colIndex) {
var rec = grid.getStore().getAt(rowIndex);
alert("Terminate " + rec.get('firstname'));
}
}]
}
]
});

Reference a carousel xtype from within a container in sencha touch 2

I have this code:
Ext.define('play.view.Quiz', {
extend: 'Ext.Container',
xtype: 'myquiz',
config: {
fullscreen: true,
layout: 'vbox',
title: 'My Quiz',
items: [
/* Questions */
{
xtype: 'my_questions'
},
]
}
});
and
Ext.define('play.view.Questions', {
extend: 'Ext.Carousel',
xtype: 'my_questions',
config: {
defaults: {
styleHtmlContent: true
},
items: [
{
html : 'Item 1',
style: 'background-color: #5E99CC'
},
{
html : 'Item 2',
style: 'background-color: #759E60'
},
{
html : 'Item 3'
}
]
}
});
The questions wont display, yet when i place the questions within the quiz items, they display.
Is it possible to reference a carousel xtype from a container?
Yes #Bohbo can you do something like this:
Ext.define('play.view.Questions', {
extend: 'Ext.Carousel',
xtype: 'my_questions',
config: {
defaults: {
styleHtmlContent: true,
layout: 'fit',
items: [
{
html : 'Item 1',
style: 'background-color: #5E99CC'
},
{
html : 'Item 2',
style: 'background-color: #759E60'
},
{
html : 'Item 3'
}
]
},
});
Note important element is layout:'fit'. I hope this helps. :)

sencha touch 2 list 100% height

2 panels:
Ext.create('Ext.Container', {
fullscreen: true,
layout: 'hbox',
items: [
{
xtype: 'panel',
html: 'message list',
flex: 1,
items: [
{
xtype: 'list',
itemTpl: '{title}',
data: [
{ title: 'Item 1' },
{ title: 'Item 2' },
{ title: 'Item 3' },
{ title: 'Item 4' }
]
}
]
},
{
xtype: 'panel',
html: 'message preview',
flex: 3
}
]
});
There is no height attribute specified in first panels list object, so it is not available for display. How can i set 100% height in xtype: 'list' ?
You need to give the lists container a layout so it knows to stretch its children (the list).
layout: 'fit'
Using fit will tell your panel to make all children (only the list in your case) to stretch to the size of your panel.
Example of this on Sencha Fiddle.
And here is a great guide on all the available layouts in Sencha Touch 2.0.