In tabulator, what setting will allow for table to expand so that all contents are visible? - tabulator

When using fitColumns setting of tabulator, if the table is wider than the containing div, the columns shrink so they the table fits in the div. It appears one can use widthShrink: 0 to prevent column shrinking (I have not tried this yet). Is it possible to specify widthShrink for all columns? I am creating the table from an existing table, and hence do not specify columns and data manually.
Also, is it possible to prevent the scrollbar on the table div when the table gets wider than the containing div. I would prefer that the user scroll the entire page to see the table (instead of just the table div).
Thank you.

You are using the wrong layout mode if you want the columns to overflow the table, fitColumns is specifically designed to fit the columns to the table. the fitData layout mode will allow the columns to overflow the table naturally. You can set widthShrink: 0 on all the columns, but at that point you are essentially disabling the layout mode anyway.
There is no built in feature for allowing external scrolling of the table. The table is based in a div and so will take up 100% the width of its parent element.
It will then either handle scrolling inside the table or resize the columns to fit depending on how your table is configured
You could make some CSS tweaks to allow this form of display but it may cause the table to malfunction under certain circumstance, depending on your configuration.
You would need to include the following CSS after the tabulator style sheet has been included:
.tabulator, .tabulator-header, .tabulator-tableHolder{
overflow:visible !important;
}
But essentially at that point you may be better off just using a standard HTML table as you seem to be disabling a lot of the features that you would use Tabulator for.

Related

Scrolling Not Working with Long Content in Tabulator

I have noticed that when I have cells with a lot of text, the table will not scroll vertically. As I scroll down, the table jumps back to the top. The behavior is a function of the amount of content and the width of the column. A wider column can handle more content before this behavior is seen.
I thought this was due to my own custom formatter, but it also happens for the textarea and html formatters.
This can happen if the row content is significantly longer than the height of the table.
In this case you can improve the scroll stability by increasing the size of the virtual dom render buffer on the table. this is the amount of space that the table renders above and below the table to allow smooth scrolling.
It is be default set to 2 times the height of the table. You should make sure it is at least 5 times the height of your tallest row.
This can be done using the virtualDomBuffer option in the table constructor:
var table = new Tabulator("#example-table", {
virtualDomBuffer:300, //set virtual DOM buffer to 300px
});
More information on this can be found in the Virtual DOM Documentation
Though from a user experience perspective i would query whether a table is the best way to layout data if it takes up a large vertical space. It would probably be clearer to display summary information in rows, and then use either a rowFormatter to toggle a details section under the row, or a modal to show more detail

Disable sorting on one or more grid columns in Kendo UI for Angular

I'm playing around a bit with Kendo UI for Angular and can't seem to find an easy way to disable sorting on specific columns of a grid.
There's an allowUnsort in sort-settings.d.ts, but I'm uncertain on how to use this (and this appears to relate to removing sorting afterwards, not from the start).
Or perhaps I'm simply using the grid wrong, that's also possible..
My situation is as follows:
I'm trying to use a grid to display some rows, and depending on the type of data, it should render a different icon in the first column. Also, I'm not using a 'real' header in that column, but replaced it with a button to create a new row.
To get my button in the header, I use a <template kendoGridHeaderTemplate ...>...</template>. This always seems to add a link around the header cell if sortable is enabled, which is what I'm trying to avoid (in some cases).
Is there a way around this?
Setting [sortable]="true" for the Grid component will enable sorting globally. Then you can fine-tune which column has sorting by disabling it per column, i.e [sortable]="false"
Here is a quick example:
http://plnkr.co/edit/hLbzC5jKJwVdMtRmh0cH?p=preview

How can I left align the extra columns in an Xpages Data View

DataViews really provide almost everything I want in Xpages views EXECPT that I cannot control how extra columns appear. They are always right aligned. Is there a way to make them left aligned? I don't want a tremendous amount of space between the summary column and the extra columns.
The column sizing seems in that way, because the width of the Summary columnn is set by renderer (100% for usual dataview).
If you could remove that width: 100% style, the sizing of column would be usual.
There are a couple of ways to do that but neither is elegant.
Using CSS will not be a nice technique, but it will work. Since we can't address that specific column with a class name and width style is inline, we can define myRowStyle as the rowStyleClass for our dataview control and use the following rule:
tr.myRowStyle td { width: auto !important; }
Now, we will consider some problems of course. Any inline or CSS definition for other columns will be overridden by this rule. Also if you use any table within these columns, they will be effected too.
You can define a more specific selector for minimum side effect, but this will not work for older browsers (e.g. IE8):
tr.myRowStyle > td:nth-child(2) { width: auto !important; }
Alternative way is to write a short dojo script which finds the second TD within every row and remove width property. You might put such as a script just after the data view. For browsers with a slow connection might see a flickering on rendering stage for this case.

IBM Cognos Cross Tab alignment

I have placed two crosstabs one below another. But They are not getting aligned. How to align the two cross tabs such that corresponding columns align perfectly.
The quick and dirty way is to use fixed widths on all cells.
This will work fine for PDF, but will not work for HTML if:
You're using a modern browser (IE9+, FF/Chrome from last 5 years)
The total width exceeds screen size
There is no total width set on the crosstab itself
It will then ignore the cell widths and try to force everything to the screen width, thus the crosstabs will not align again.
I wrote some JavaScript awhile back which will combine two tables into one so fixed width is not needed. The full blog post is here. This will only affect HTML outputs, so for PDF I created a second page and just conditionally rendered one depending on user selection.
Fixed width is the only viable solution )
But you can use Report Classes to have a single “width” definition and apply it everywhere. It actually makes your reports look way neater.
Use Blocks in the cross tab cells, you will need to unlock the report first to do this
Set the block size to be the same on both cross tabs and then select content is clipped (Size and overflow property of the block)
This will work for both html and pdf output
I was able to do this by doing the following:
Set the Size & Overflow > Width of BOTH crosstabs to the same width in pixels.
Unlock the report, select the crosstab Text items in BOTH crosstabs and set them all to the same width (or individual columns to the same width if needed).
With the report still unlocked, select the text items in the crosstab 'Rows' and set those to the same width.
It's not pretty, but nothing in Cognos ever is.

How to specify the width of site column in a list?

I have developed a list in SharePoint. While entering new item in it, like name, if I keep on typing it gets spread over a line making the width of cloumn spread over page. I want to limit the width of site column so as the column's value spreads over multiple lines instead of spreading over one. How can I do this setting?
This is not a setting you can configure in SharePoint. You will need to write some custom code using css and possibly javascript that will set the width of the column. You can make a change like this in SharePoint Designer.
You must use min-width (CSS) in your block.
You have to create custom XSLT for this. There you have loop all the column and need to specify the overflow:auto, hidden,.. CSS property. So it automatically get effect based on your internal name of the field.
So whereever you have the field it automatically get affected. If it for one single view you can use JavaScript to achieve this but this is not right way to do.
The data you are entering can be displayed in many ways. Today in a table format, tomorrow in a dropdown etc. You should distinguish between:
limiting the amount of data that can be entered in a site column (can be done in SharePoint alone, when you design your list)
limiting the wrapping of the words in a table cell today or trimming the values in a dropdown tomorrow (can be done using HTML/CSS "nowrap" if you display the list values in a browser app, or differently if you show the values in a WinForms app)

Resources