I'm having a few issues when attempting to make the switch from extjs 4.0.7 to 4.1.1.
The first issue is as follow:
I have two treepanels which are within a column layout. One right next to the other. My app loads a bunch of nodes into the left panel, and then you can optionally move some of them to the other panel. However, the panel with all the nodes is not showing a scrollbar, and thus I can't see about 1/3 of the nodes all of a sudden. I had a semi-similar issue in 4.0.7 where I couldnt see the last node moved if the panel was full until I moved another node. I fixed that with the following lines:
treePanel1.invalidateScroller();
treePanel2.invalidateScroller();
These lines are deprecated in 4.1.1, and the problem seems to have become worse. Has anyone had a similar issue, and how do I get my scroll bar back.
A second major issue related to my UI:
I have two grids right next to each other elsewhere, layed out similarly to the treepanels. I've set up drag and drop between the two grids. Again all the nodes start in the left grid, with the option to drag some into the right grid. However, the right grid is now not showing at full size, it is defaulting to a sliver. So, the DD functionality is still there, if you know to drag the node to that little sliver. Afterwards, the sliver expands enough to hold the single node and so on. So, how do I get it back to defaulting full size. Why had extjs 4.1.1 caused these issues? I'd have to fat finger in any code, but can if absolutely neccessary. However, if anyone is familiar with this type of issue based on my description, that would be great.
Edit: Also, I have a combobox in the right-most column of the grids. When I click to change one of the comboboxes, a mini scrollbar thing pops up that sort of blocks the dropdown button. What have they done to this version?
Here is the layout definition where I have the first problem where the scrollbar doesn't show up on the panel when it needs to:
{
xtype: 'panel',
title: 'Select fields',
defaults: {
border: false,
height: '100%'
},
layout: 'column',
items: [
{
xtype: 'treepanel',
itemID: 'choicesTreePanel',
title: 'Choose from below fields',
height: '100%',
multiSelect: true,
store: choicesTree,
rootVisible: false,
columnWidth: .44},
{
xtype: 'panel',
columnWidth: .06,
layout: {
type: 'vbox',
align: 'center'
},
defaults: {
margins: "15 0 0 0"
},
items: [
{
xtype: 'button',
text: '==>'},
{
xtype: 'button',
text: '<=='},
{
xtype: 'button',
text: 'RST'}
]},
{
xtype: 'treepanel',
itemId: 'chosenTreePanel',
title: 'Fields',
border: true,
store: chosenFields,
rootVisible: false,
columnWidth: .44,
viewConfig: {
plugins: {
ptype: 'treeviewdragdrop,
dragText:'
dragginggggg '
},
ddGroup: '
fieldsDD '
}
},
{xtype:'
panel ',
columnWidth:.06,
layout:{
type:'
vbox ',
align:'
center '
},
items: [
{
xtype: '
button ',
text: '
UP '},
{
xtype: '
button ',
text: '
DOWN '}
]
}
]
}
Edit: on the left panel, if I make height a set value, and autoscroll true, I have a scrollbar. If I set height '100%' and autoscroll true, there is no scroll bar. So a solution might be to find out how to have the panel fit the height of the parent, while maintaining the scrollbar
Although you are looking for a percentage based height solution, you can also use a constant value height. In many cases this will avoid your problem. For example, set the panels to 600 height, that should fix the scroller issue.
This does not solve your issue in percentage based layouts. Hopefully someone else can provide help with that.
(maybe it is best to split your question into multiple separate questions)
Concerning your first question about the panel height and scrollbar:
In your example I would ask myself the question "I want the treepanel to have a 100% height related to what?".
A column layout is typically used when you don't care about the height of the child elements related to their parent: the sum of the height of the child elements define the height of the column as you can see here: http://docs.sencha.com/ext-js/4-1/extjs-build/examples/layout/column.html.
You did not define any height on the columns, so it uses the height of the child elements (which have no height in your example). I don't know what Ext does in this case, but based on this, it cannot do anything smart.
If you want the treepanel to use the whole height of the containing panel, you would use a hbox layout with the align property set to stretch.
That might fix the scrollbar too since height calculation can be done properly.
Don't forget to remove the "height: 100%" and "autoscroll" properties since they mix things up.
Finally, changing the layout of the treepanel to 'fit' might give you the result you are looking for.
Your code might become something like:
{
xtype: 'panel',
layout: {
type: 'hbox',
align: 'stretch'
},
items: [{
xtype: 'treepanel',
layout: 'fit',
flex: 44,
...
}, {
flex: 6,
...
},{
flex: 44,
...
}]
}
I did not test this answer on your code. Please provide a full working code sample (with a dummy store) and I'll test it.
Related
Ref: https://atomiks.github.io/tippyjs/
The z-index seems not be working when specifying interactive:true (then it falls behind other elements) although I specify the #main_container. How can I get it "on front of everything" with interactive:true?
delegate( '#main_container', {
target: '[data-tippy-content]', allowHTML: true,
interactive: true, placement: 'right', theme: 'light', zIndex: 99999
} );
see also here: https://github.com/projectje/bookmark for the above code. I made a temporary workaround by placing a BR behind every first character so that it will not flow over other boxes. But this is really a short-term workaround.
The tippy is appended to the reference element's parent by default when interactive — this can cause it to be clipped if the parent is a "containing block".
To fix use one of these:
Use popperOptions: { strategy: 'fixed' }, or
Specify appendTo: document.body + focus management for keyboard usage
I have a nested grid, and I am able to change the nested grid row background color based on the value of one of its columns. But I would like to also be able to change the color of the parent row.
For example: Parent:Study, Child:Site, Condition:column Status=pending.
If a site has a status of pending, I would like to change the row color for the pending site, and also change the row color for the study the contains that pending site.
var cellclassname = function (row, column, value, rowdata) {
if (rowdata.Status =="Pending") {
return "red";
}
}
The code above works for the nested grid:
columns: [
{ text: '<b>Site ID</b>', datafield: 'ID', width: '15%', cellclassname: cellclassname},
{ text: '<b>Organization Name</b>', datafield: 'SiteName', width: '70%', cellclassname: cellclassname},
{ text: '<b>DSA</b>', datafield: 'Status', width: '15%', cellclassname: cellclassname} ]
but not for the parent grid:
columns: [
{ text: '<b>Study Filter</b>',
datafield: 'StudyName', width: '100%', cellclassname: cellclassname }
]
How can I modify my cellclassname function so it will change the row color for the parent row as well?
Thanks in advance!
I created a work around solution.
From the database side, I was able to generate the parent data with an extra column, which says if any of the child information has a pending, then the parent study will also have a pending status. So when generating the grid, I was able to color the parent row based on that information, and I made the status column hidden.
I am still curious to know how I could have done it using the jqwidgets functions instead of modifying the source data.
I have a panel which have 2 items, a start button and a save button.
the start button is at the bottom left corner
the save button is at the bottom right corner
the save button is hidden, when shown using show() the save button appears on top of the start button. If all these hide and show calls are removed the buttons rendered in the correct location, both of them.
Anyone know why this maybe ?
It is a straight up panel with items: [startbutton, spacer, savebutton]
Oh god I really hate this one framework..
You're probably confused about the layout management in ExtJS (which is actually quite nice once you understand how it works). Also you want to make sure that you perform a doLayout after you've toggled an element's visibility to make sure that everything gets placed properly.
Look at this jsfiddle: http://jsfiddle.net/LVKyM/
Ext.onReady(function(){
var pnl = new Ext.Panel({
renderTo: 'ctn-panel',
width: 300,
cls: 'my-pnl',
bodyBorder: false,
border: false,
layout: 'hbox',
layoutConfig: {
padding: 5
},
items: [
startBtn = new Ext.Button({
text: 'start',
width: 100,
hidden: true
}), {
xtype: 'spacer',
flex: 1,
}, {
xtype: 'button',
text: 'save',
width: 100
}
]
});
new Ext.Button({
renderTo: 'button-container',
text: 'Show/hide',
handler: function(){
startBtn.show();
pnl.doLayout();
}
});
});
I have been tasked with moving existing ExtJS 4 Panels on a page, rendered to separate divs, into an Accordion layout; I have moved the divs into the Accordion as items, and the Panels are being rendered well enough.
In my particular situation, however, the Accordion Panel applies some (10px all round) padding that I would like to remove.
I have a suspicion that it might be to do with some preexisting table styling that I unfortunately can't remove. What stylesheet modifications should I be making to specifically target the accordion control and its contents, such that the Panels contained within the Accordion Panels fit against all four edges?
If it might not be CSS styling, or if it can be as easy as an Accordion config/property, what should I be setting to remove this whitespace? I have tried some of the settings that looked promising, but have not fixed the issue.
Or, in the more negative circumstances, do I have to move the Panels directly into the Accordion, which brings with it yet more problems?
Essentially, how do I make the contents of each Panel in an ExtJS Accordion Layout fit the width and height of their individual Accordion Panel exactly without whitespace?
Accordion panel ExtJS code:
var accordion = Ext.create('Ext.panel.Panel',{
bodyPadding: '0px',
width: '370px',
autoHeight: 'false',
layout: 'accordion',
items: [
{title: 'Drawing', html: '<div id="Image" style="padding: 0px, margin: 0px; border-spacing: 0px; height: 350px"></div>'},
{title: 'Production Processes', html: '<div id="Process" style="padding: 0px, margin: 0px; border-spacing: 0px"></div>'},
{title: 'Production Item Details', html: '<div id="Details" style="padding: 0px, margin: 0px; border-spacing: 0px"></div>'}
],
renderTo: Ext.get('Accordion')
});
My workaround has been to take the pre-existing panels and apply collapse control variables:
var drawingPanel = Ext.create('Ext.panel.Panel', {
animCollapse: false,
collapsible: true,
autoWidth: true,
titleCollapse: true,
collapseFirst: false,
collapsed: true,
...
This starts the panel as collapsed, and collapse/expand/beforerender listeners to set/get cookies that control a persisted state:
...
listeners:{
expand: function(){
var now = new Date();
var exp = new Date(now.getTime() + 2592000000); //number of milliseconds equal to 30 days from now
Ext.util.Cookies.set('panelCollapsed', 'false', exp);
},
collapse: function(){
var now = new Date();
var exp = new Date(now.getTime() + 2592000000); //number of milliseconds equal to 30 days from now
Ext.util.Cookies.set('panelCollapsed', 'true', exp);
},
beforerender: function (){
var cookieSet = Ext.util.Cookies.get('panelCollapsed');
if(cookieSet == 'true')
{
Ext.apply(Ext.getCmp('panel'), { collapsed: true });
}
else
{
Ext.apply(Ext.getCmp('panel'), { collapsed: false });
}
}
}
});
Other attributes of the panel have been stripped out to demonstrate the salient points.
This implementation does consider a panel on its own; the expand and collapse listeners could feasibly control the collapsed state of other panels as necessary. Admittedly, this probably isn't as efficient as getting the accordion control to work properly, but if they don't work as expected, this is a start.
I am unable to get a textfield I have created in ExtJS to align vertically to the bottom.
The problem is that no matter what I try - it stays vertically aligned to center inside the textfield (the textfield itself is stretched). It is a little hard to explain so I have created a JSFiddle to demonstrate my problem:
http://jsfiddle.net/w3gfy/
CSS Code:
.exx-valign-bottom { vertical-align: bottom; }
ExtJS Code:
items: [
{
xtype: 'textfield',
flex: 1,
itemId: 'teQuantityField',
fieldCls: 'x-form-field exx-valign-bottom',
fieldStyle: 'vertical-align:bottom;',
readOnlyCls: 'x-form-readonly exx-valign-bottom',
cls: 'exx-valign-bottom',
labelAlign: 'top',
labelSeparator: ' ',
emptyCls: 'x-form-empty-field exx-valign-bottom',
emptyText: 'Align me'
}
]
As you can see I have tried placing it literally everywhere without any luck. Does anyone have any idea how to do this properly?
Edit:
I tried adding this container (see JSFiddle). Is this the right way to do it? Or is there another way?
http://jsfiddle.net/w3gfy/2/
not sure what do you want but for complex alignment i use
style:{marginLeft:'__px',marginRight:'__px',marginTop:'__px',marginBottom:'__px'}//use Which marginProperty you want and use numeric values in the"__"
I solved this problem by using a grid instead of a form.