Weird behaviour moving splitter in ExtJS borderlayout - extjs

I have a Viewport with a Borderlayout. Between center and west there is a splitter. When I move the splitter to the right, it gets a new position, but it scrambles my whole layout:
Before moving it looks like this:
After moving (not while moving!), the splitter is "hidden" and only visible when I hover over the new position. Look at the right - there is a new unwanted margin:
When I move the splitter to the left (just a few pixels), the new layout is applied correctly!
In case you need code, here I have the panel with the border-layout. If you need more, I'll provide it immediately.
Ext.define('MyApp.view.Main', {
extend: 'Ext.container.Container',
requires: [ // ...
],
layout: {type: 'border'},
items: [{
region: 'north',
height: 50,
collapsible: false,
frameHeader: false,
html: 'Main'
},{
region: 'west',
xtype: 'panel',
title: 'west',
collapsible: true,
resizable: true,
frame: true,
border: false,
width: 250,
layout: 'fit',
tools: [ // ...
],
items: [{
xtype: 'workoutlist'
}]
},{
region: 'center',
title: 'center',
xtype: 'centerView'
}]
});

Thanks to #Evan Trimboli I've replaced resizable: true with split: true, which helped in another problem.
The real cause of the problem was in the centerView:
Ext.define('MyApp.view.CenterView', {
extend: 'Ext.tab.Panel',
alias: 'widget.centerView',
enableTabScroll: true,
layout: 'fit',
// constrain: true, <-- this configuration option caused the weird behaviour
autoShow: true,
// ...
});
I don't know how the option constrain: true came to this view (probably some silly copy and paste error). Without, it works like a charm.

Related

How to use Ext.XTemplate directly on a panel on ExtJS 6/7

This doesn't show anything inside the panel body:
{
xtype: 'panel',
title: 'Test',
region: 'east',
width: 400,
tpl: new Ext.XTemplate('<p>Hello world</p>'),
split: true,
collapsible: true
}
The panel is correctly rendered, since I can put data inside the "html" property and it works.
I'm pretty sure I'm missing something pretty obvious.
You will need to provide a data config to display the tpl. As per to docs, it works in conjunction with data. For the time being, the data can be an empty array.
Refer the below code or fiddle
{
xtype: 'panel',
title: 'Test',
region: 'east',
width: 400,
height: 400,
data: [],
tpl: new Ext.XTemplate('<p>Hello world</p>'),
split: true,
collapsible: true,
renderTo: Ext.getBody()
}

Ext.js, Nested Form panel not scrolling on mobile devices

I am new to Ext.js & am having some issues scrolling a nested form on mobile devices. I have a grid panel & a form panel both inside the 'center' panel & I hide one depending on which selection was chosen in west panel. The grid section works fine (& scrolls in mobile thanks to the bufferedrenderer plug-in.) but I can't get the form to. It scrolls fine in desktop view & it even scrolls when I preview the mobile view in Chrome dev tools but when I try to use it on an actual device, there are no scroll bars & I can not drag the screen either. I've tried so many different ways but here's the gist of what I have. Any suggestions are appreciated.
Ext.define('App.view.main.Main', {
extend: 'Ext.container.Container',
plugins: ['viewport', 'responsive'],
xtype: 'app-main',
autoscroll: true,
defaults: {autoscroll: true},
overflowY: 'auto',
responsiveConfig: {
tall: {
layout: {
type: 'auto'
}
},
wide: {
layout: 'border'
}
},
items [{
xtype: 'panel',
region'north'
},{
xtype: 'panel',
region'west'
},{
xtype: 'panel',
region:'center'
autoscroll: true,
layout: 'fit',
items: [{
xtype: grid,
......
},{
xtype: 'form',
layout: 'fit',
height: '500',
autoscroll: true, //this does nothing??
overflowY: auto, //this does nothing either???
responsiveConfig: {
wide: {
layout: 'hbox'
},
tall: {
layout: 'auto'
}
},
layout: {
type: 'box',
align: 'stretch'
},
items: [{
xtype: 'textfield'
},{
xtype: 'textfield'.....
}]
}]
}]

Resizable Grids in Accordion Container

I have 3 grids within an accordion container.
I add the resizable property to true to all 3 grids.
But when I try to resize any of the Grids, they are instead dragged up or down, instead of growing, and taking up the space.
What could be wrong?
Ext.define('MCS.view.task.Mygrid', {
requires: ['MCS.view.task.Mytoolbar'],
extend: 'MCS.view.base.grid',
alias: 'widget.myGrid',
itemId: 'myGrid',
stateId: 'myGrid',
iconCls: 'icon-application',
cls: "mcs-header2 mcs-accordion-item x-docked-noborder-top mcs-border-bottom",
bodyCls: "mcs-grid-body",
collapsible: true,
border: true,
hideMode: 'offsets',
resizable: true,
flex: 1,
store: 'task.My',
viewConfig: {
loadMask: false
},
dockedItems:
[
//stuff here
]
});
Accordion ( the 3rd grid is added dynamically to the bottom of the accordion )
xtype: 'container',
flex: 3,
layout: { type: 'accordion', border: false, multi: true, fill: false },
items: [
{ xtype: 'myGrid' },
{ xtype: 'pendingGrid' }
]

Accordion-Ux.layout.accordion list data does not show sencha touch

I am using accordion layout, the data from the store loading fine for the collapsed items and we can see when it is expanded but for the items collapse: false,data is not loading.It is working fine on Firefox,but not working on Chrome and iOS simulator Can anyone please help me on this issue. I am using latest sencha touch version 2.2.1
here is my code
config: {
title: 'Check out',
iconCls: 'truck',
layout: {
type: 'accordion',
toggleOnTitlebar: true,
mode: 'MULTIPLE',
},
scrollable: 'vertical',
items: [{
itemId: 'cartitems',
title: 'Cart Items List',
height: 600,
layout: 'fit',
collapsed: false,
items: [{
xtype: 'list',
scrollable: {
direction: 'vertical',
directionLock: true
},
itemTpl: '<div class="cartitemlist">{DESCRIPTION} Item ID:{REDID} Price:{Price}</div>',
store: 'CartStore'
}]
}
data is showing up if the collapsed : true .. but it is not working when collapsed: false
Try adding a height to the list view. E.g.
items: [{
xtype: 'list',
height: 500,
scrollable: {
direction: 'vertical',
directionLock: true
},
itemTpl: '<div class="cartitemlist">{DESCRIPTION} Item ID:{REDID} Price:{Price}</div>',
store: 'CartStore'
}]

Extjs4 tabpanel, disable all child item without looping them

is there are any way to disable all child items on Extjs4 tab panel, without looping them.
my code:
var myPanel = new Ext.TabPanel({
region: 'east',
title: 'my panel title',
width: 200,
id: 'my-panel',
split: true,
collapsible: true,
collapsed: true,
floatable: true,
xtype: 'tabpanel',
items: [
Ext.create('Ext.panel.Panel', {
id: 'my-detail-panel',
title: 'My Info',
autoScroll: true,
file: false,
type: 'vbox',
align: 'stretch',
tpl: myDetailsTpl
}),
Ext.create('Ext.panel.Panel', {
id: 'my-more-detail-panel',
title: 'My more info',
autoScroll: true,
file: false,
type: 'vbox',
align: 'stretch',
tpl: myMoreDetailsTpl
})
]
});
i need disable myPanel's all child items, but still need to 'myPanel' keep status as enable .
myPanel.items.each(function(c){c.disable();})
then
myPanel.items.each(function(c){c.enable();})
to fire them back up again.
This is looping, but it is not using a "for loop" as I think the question was meant to state.
You can just set disabled:true on the initial config for each panel. Is that what you were asking?
Try his:
// Create your own property for storing statu,
config{
allMyTabItemsEnabled = true;
}
// Then on all the items you want to disable/enable, add:
bind: {
disabled: '{!allMyTabItemsEnabled }'
}

Resources