Column width on webgrid lost after postback - css

I have a very simple webgrid with 3 columns:
View
columns: grid.Columns(
grid.Column("Applicant Name",
format: (item) => #Html.ActionLink((string)item.Name, "EditApplicant", "Applicant", new { id = item.ApplicantId },
null), style: "AppName")
, grid.Column("Role", "Role", style: "Role")
, grid.Column("ApplicantSkills", "Skills", style: "AppSkills")
I want to set my columns to a fixed width. I have tried using percentage widths here and exact widths like 500px, 100px etc, and they all work initially, but are lost after postback.
css:
.AppSkills {
width: 70%;
}
.AppName {
width: 20%;
}
.Role {
width: 10%;
}
My grid is a results grid, which is populated from a number of filters, so every time the user selects different filters and clicks search the results are changed and the grid re-populated. What im finding is the grid column width style is being lost. Here is what my screen looks like. Initially it looks fine, but after selecting different filters and hitting search, the grid column widths are lost.
I have tried posting my form as a GET and a POST to see if it was the Get that was losing the formatting. But both yield the same results.
#using (Html.BeginForm("Search", "Home", FormMethod.Post))
{
Is there anything obvious I'm doing wrong here? Or is there any way I can ensure a fixed width on my grid columns so they don't move about?

You're missing spaces after the commas, so it's probably treating one of the entries as a big unbreakable word. If you can't change the underlying data, assuming it isn't the code doing the concatenation, you might be able to use the css word-break property to sort it.

Make sure that after postback that the grids still have the classes applied to them.
Also, please post the HTML for us to view so we can diagnose the problem since we are not to sure if they are styled divs or a table.
If it is a table, try running the following CSS. Basically, it will target the columns individually without class names, just in case the classes are lost during postback.
td:nth-child(3) {
width: 70%; /* targeting the skills column */
}
td:nth-child(1) {
width: 20%; /* targeting the name column */
}
td:nth-child(2) {
width: 10%; /* targeting the role column */
}

Related

Media query works with bootstrap classes but not with my id or class

I'm a little new to this, so apologies if it's a dumb question, just can't find the answer elsewhere.
I am building a form with several groups of colspan 6 to create the effect of 2 columns. I need to raise a group to cover some empty space when a large viewport is in use. I have the following CSS which works on the form:
#media screen and (min-width: 992px) {
.dxbs-fl-gt.col-lg-6.col-12 {
position: relative;
top: -105px;
}
}
That's all well and dandy until I check out a similar form and see that one of its groups is now raised making that form look off. In order to affect just the 1st form, I tried replacing the bootstrap classes (.dxbs-fl-gt.col-lg-6.col-12) with a div class (and then an id because it's just for this one spot), but it's as if that CSS is now ignored totally. Here is my new CSS for the sake of thoroughness:
#media screen and (min-width: 992px) {
#vendorAddressGroup {
position: relative;
top: -105px;
}
}
I've tried moving my div tags to several places all of which surround the group, but no joy. Can anyone advise on what to try next?
My HTML:
<div id="vendorAddressGroup">
<DxFormLayoutTabPages ColSpanXs="12"
ColSpanLg="6"
ActiveTabIndex="#ActiveTabIndex1">
<DxFormLayoutTabPage Caption="Main">
#switch (ActiveTabIndex1)
{
case 0:
#*Address Group*#
<DxFormLayoutGroup Caption="Address"
ColSpanXs="12"
ColSpanMd="12"
ColSpanLg="12">
#*Various <DxFormLayoutItem>s*#
</DxFormLayoutGroup>
#*Contact Group*#
<DxFormLayoutGroup Caption="Contact"
ColSpanXs="12"
ColSpanMd="12"
ColSpanLg="12">
#*Various <DxFormLayoutItem>s*#
</DxFormLayoutGroup>
break;
}
</DxFormLayoutTabPage>
<DxFormLayoutTabPage />
<DxFormLayoutTabPage />
<DxFormLayoutTabPage />
</DxFormLayoutTabPages>
</div>
As per DevEx, need to get DevEx Blazor 21.1.5, "wrap tabs in the DxFormLayoutGroup element and specify the CssClass property for this element. Then, you can use this CSS class to create a media query specific to that group." Can't update yet so can't test it, but sounds promising.

css: applying text-align and appending text in a single rule

I am looking to present a set of properties. key: val type-of-thing. Not knowing any better, I am laying it out in a table.
The following css:
table.properties td:first-child {
text-align: right;
}
table.properties td:first-child::after {
content: ":";
}
aligns the text in the 1st column (the keys) to the right, then appends a semicolon.
Is there a way to express that in a more concise way? Like in a single rule? Or maybe such presentation is better done in another manner altogether?
Appreciate a tip!

PrimeNG filter dropdown issue in scrollable turbo table

In prime-ng turbo table , when we put filter dropdown in scrollable table dropdown going inside the table
Without scrollbale table dropdown works perfect.
This works perfect
but when scrollable table , dropdown is going inside the table
Not works perfect.
so I want to do dropdown outside the table not inside the table.
This is a link https://primeng-table-bry1sl.stackblitz.io/ to see the code. Please see in 1024 resolution so you can see the scroll in the table and select one of the brand to filter the data.
Can anyone help me.
Try to use appendTo="body" attribute available on dropdown of Primeng, which might be helpful in your case.
Complete example here -
<p-dropdown appendTo='body' [options]="value" [style]="{'width':'100%'}" placeholder="Select"></p-dropdown>
Reference from here
The problem is here:
.ui-table-resizable .ui-table-thead>tr>th, .ui-table-resizable .ui-table-tfoot>tr>td, .ui-table-resizable .ui-table-data>tr>td {
/* overflow: hidden; */
}
Try to comment the overflow attribute or set to visible ... it works!
Solved by overwriting the below overflow to be visible:
//Old code in primeng.min.css
.ui-table-scrollable-header, .ui-table-scrollable-footer {
**overflow: hidden;**
border: 0 none;
}
//add this to your stylesheet instead
.ui-table-scrollable-header, .ui-table-scrollable-footer {
**overflow: visible;!important**
border: 0 none;
}
Also, add this in your stylesheet after the code above:
.ui-table-scrollable-view {
overflow: hidden!important;
}
see here result image

How to change css of a grid cell of a row in Extjs 4.1.3

I have an ExtJs grid, whose 1st row is used as temporary row. In the grid certain columns are non-editable. I want to show non-editable cells of first row(temporary) as non-editable. As that temporary row does not have any values so how to show those cells as non-editable (like greying out that cell only)
As selected in the image, I want to show those cells as greyed out
Obviously this will be achieved by applying a CSS rule to those elements. To target the column we will be using the tdCls column config.
A CSS class names to apply to the table cells for this column.
To target the row, usually the getRowClass method is used, but in this this particular case I think this will be an overkill, because it will be called on every row of the grid, we just need a class for the first row. So I think the way to go is by adding the class to the first row on view's viewready event.
That being said, here is how the solution could look. Add a tdCls for the needed columns:
{
text: 'Serial',
dataIndex: 'serial',
tdCls: 'serial-column',
width: 200
}
Add a class to the first row:
viewConfig: {
listeners: {
viewready: function (view) {
Ext.get(view.getNode(0)).addCls('first-row');
}
}
}
Then just apply the needed styling via CSS:
.first-row .serial-column {
background: #ccc;
}
Here is a working fiddle: https://fiddle.sencha.com/#view/editor&fiddle/26aq
P.S.
This is a really good tutorial about styling ExtJS grid cells: http://skirtlesden.com/articles/styling-extjs-grid-cells

How to make field wider?

Im trying to make wider field of "last post" in phpBB. I edited CSS "lastpost" class from 250 to 300 value but looks like left fields are not responsible so extended field goes on next line and forum's list get f*ed up. What I should edit more?
Address of phpBB is: http://schiza.me
Thanks
You need to change multiple selectors.
Here is an example :
dd.lastpost, dd.redirect, dd.moderation, dd.time, dd.info {
width: 300px;
font-size: 1.1em;
}
Other table lines will need to always keep the same total size you will migth want to change an other property like that one for th number of topics and views :
dd.posts, dd.topics, dd.views {
width: 75px;
}

Resources