I'm using Materialize's grid system, where I have a Row with dozens of l3 columns. It works as expected and it displays 4 cols per line.
Now I want to be able to enlarge a column on click (making it l9). I already succeded in toggling the l3/l9 class on click, but I'm having issues with the push / pull functionality.
If the clicked column is in the 3rd or 4th position, I want to pull it by 3 or 6 respectively, so it stays on the same line.
At the same time, I'm pushing the columns that come before it by 9, and I expected them to break to the next line accordingly.
The problem is: instead of breaking to the next line they are overflowing the row, totally breaking the design.
Is there a way to achieve this?
Not really a lot to go off of and not sure if I'm right, but maybe you can do something like this:
$('.row.l3').on('click',function(){
if($(this).index() <= 1){
... Toggle push
}else{
... Toggle pull
}
})
Also, remember that you should only have a total of 12 col(for example: l3+l3+l3+l3) in each row.
Good luck solving your problem =)
Related
I want to create a resume using the {pagedown} resume template. Overall, it's a great fit, but when I use bullet points, I would like to align the second line of text to the first one.
Here is the current state:
I would like to align the w in the second line to the E in the first one.
I guess, this needs to be set somewhere in the resume.css, but I have not found anything related (but I don't really know CSS, so that means nothing).
Any ideas how to accomplish that?
I have tableView with first column for row number. I would like to set CONSTRAINED_RESIZE_POLICY for all columns without first.
I made:
//First column implementation
column.setPrefWidth(40);
column.setResizable(false);
... //Make other columns
tableView.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
So I have first column with width I chose but other are wider than without last line in code above but still there is one additional void column.
And I have another question because I looked for resizing column to length of the longest text in column (I need it for first column) but I only found old answers with very long and tricky solutions. Is there any simple solution (method) to do it?
Edit: I found that when I try to manually resize columns, that they resize properly (as they should with CONSTRAINED) after only click to resize one of columns so I have a question, why they didn't resize from the start like I described above but after trying to manual resize. I think that problem is with setResizable false on first column but how can I repair this?
I found solution. To make other columns CONSTRAINED_RESIZE_POLICY there must be set size of the first column like below:
column.setMinWidth(40);
column.setMaxWidth(40);
and it's working without line setResizable(false).
I'm not sure how to ask this, so, feel free to ask for more information.
It seems that tableView->resizeColumnsToContents() will only resize all the columns based on data in current view. Which means that if I have more data below (which is longer in terms of counts of words), those words will be wrapped down (if the wordWrap property is set to true).
The weird thing is, if I scroll down to the bottom and refresh the data, tableView will resize those columns correctly. It seems as if tableView didn't know there are longer text below.
So, my question is, how can I make sure those columns are resized to the max based on all of the data?
My codes
QSqlTableModel *model = new QSqlTableModel;
model->setTable("item");
model->setEditStrategy(QSqlTableModel::OnManualSubmit);
model->select();
tableResult->setModel(model);
tableResult->setEditTriggers(QAbstractItemView::NoEditTriggers);
tableResult->setSelectionBehavior(QAbstractItemView::SelectRows);
tableResult->setSelectionMode(QAbstractItemView::SingleSelection);
tableResult->resizeColumnsToContents();
tableResult->resizeRowsToContents();
Update 1
I've tried tableResult->scrollToBottom() and it will only resize based on items at the bottom. So, if there are longer words in the middle, those words will get wrapped.
Update 2
If anyone would like to understand what I'm talking about, just download this example. You'll see that clicking the PushButton will generate a data that's not resized correctly.
Update 3
Possibly a bug: https://bugreports.qt.io/browse/QTBUG-9352
I managed to find a workaround for this issue, you just need to hide the table before calling resizeColumnsToContents().
For an example:
tableResult->setVisible(false);
tableResult->resizeColumnsToContents();
tableResult->setVisible(true);
I think that is because QSqlTableModel loads data on demand and the view calculates the column widths based only on data that is available. If you don't need your columns to be user-resizable, you can try this:
tableResult->horizontalHeader()->setResizeMode(QHeaderView::ResizeToContents);
I used the same workaround as described by amree, which worked great for the column widths, but tableView->resizeRowsToContents() wasn't working correctly if any offscreen columns had multiline cells that should have caused a row's height to increase.
I looked into the Qt source and it appears that some of the calculations depend on the viewport geometry. This seems to make everything work correctly for both columns and rows:
#include <limits>
tableView->setVisible(false);
QRect vporig = tableView->viewport()->geometry();
QRect vpnew = vporig;
vpnew.setWidth(std::numeric_limits<int>::max());
tableView->viewport()->setGeometry(vpnew);
tableView->resizeColumnsToContents();
tableView->resizeRowsToContents();
tableView->viewport()->setGeometry(vporig);
tableView.setVisible(true);
I added few extra columns, and now these X are back but only on the first line on certain columns. By X I mean the background the cell is crossed over like a large x. I used to have this issue before and solved it by setting the alternating color to white. Nothing else has been changed aside from adding 3 extra columns to the datagrid.
Anyone knows how to get rid of them? Thanks!
PS: whoever voted it for closing should really get off the high horse and get to work
It's probably that the columns are set to image columns and the image source is invalid. This has been my experience at least. Check the source you are providing for the image of the column.
Edit:
Then try handling DataError as it will also present red x's for columns that have thrown errors.
Apparently, CF doesn't like it when plus and minus signs are used in column.MappingName property. Hope this helps someone.
When making a line chart, Lets say its for business sales for different depts and horizontally is days and vertically is dollars. When you hover over a line it tells a dataTip tells you the sales for that dept. on that day. I want it to show all the depts at the same time, so say you hover over day 3, I want the dataTips for all depts on day 3 to display so you can compare the values for all the sales on the same day. I set the mouseSensitivity for the dataTips to display all the lines at once but I end up getting day 2 for one dept and day 3 for another which is not wanted. This is actually posted as a bug and explained better here: http://bugs.adobe.com/jira/browse/FLEXDMV-1853
I am wondering if anyone can come up with a work-around for this?
Thanks!
I ran into a similar problem to this recently and came up with a solution that also applies to your problem. I had a step LineChart and wanted to display a data tip when the user hovered anywhere on the line instead of just at defined data points.
You can read about the solution I wrote for that problem here: Flex: Customizing data tip location and behavior in a LineChart
You'll have to modify my solution slightly to fit your problem:
On line 47 you can remove the Math.abs(last.y - mouseLoc.y) < 50 check. This constrains the data tips to lines that are within 50 pixels vertically of the mouse.
I'm assuming that you're using the default segment line chart which just draws lines directly between data points. You'll need to modify the code that calculates the line value at a given x-coordinate to work with that chart type. I already find the closest data point to the left of the mouse with lines 33-41 and store it in last. Just get the next data point (which will be the one closest to the right of the mouse) and use something like this to get the value at the mouse:
var slope:Number = (nextPoint.y - last.y) / (nextPoint.x - last.x);
var lineYAtMouse:Number = (slope * (last.x - mouseLoc.x)) + last.y;
var lineValue:Array = line.localToData(new Point(mouseLoc.x, lineYAtMouse));
Then replace lines 69 through 72 with:
hitPoint.x = mouseLoc.x;
hitPoint.y = lineYAtMouse;
hitPoint.xValue = lineValue[0];
hitPoint.yValue = lineValue[1];
I haven't tested these modifications so there could be a bug or 2 but the general idea is there. I hope maybe this is still useful to someone. This question is getting pretty old. :)
Not an answer, but a poor alternative:
You could create your own DataTip renderer that [ahem] mapped the location of every point and drew the tip for each one there.
Basically, you would be duplicating a lot of the code inside the charting classes.
I have the same problem but working on column charts. Was thinking that I could enable the vertical gridLines using backgroundElements and then add a chart event listener for mouse over (which fires when mouse passes over a vertical gridline). Using the localX value, i could compare it to the closest datapoint, maybe.
Brian