How to hide treecols in treeview? - treeview

I try to hide treecols in treeview in XUL by setting style to display: none. The labels of treeview rows also disappear however. How can I hide treecols while keeping rows visible?

I guess that you mean to hide the column headers in a tree element. The tree element supports hiding individual columns so when you use display: none style on a column header the entire column is hidden with it. Instead you should use height: 0px; overflow: hidden; style on the treecols element - technically speaking it won't be hidden then but it won't be visible on screen either.

Related

Disabling scrolling on Code Mirror element

I’m trying to achieve a similar effect on a Code Mirror component that would be achieved by doing overflow: hidden on a div.
In practice this means:
No visible scroll bars
When “scroll action” takes place on the editor, the website body moves itself (i.e., impossible to scroll editor relative to the website)
How could I do that?
P.S.
A simple “overflow: hidden” didn’t work because it looks like CodeMirror creates a separate div for vertical scroll bar and horizontal scrollbar. My guess is that javascript is used to handle actual scrolling behavior. Do I need javascript to revert this?
P.S.S.
I'm using react-codemirror2, but looking for a general answer and happy to figure out how to execute it within react.
Updated Answer
CSS, where .editor is the div wrapping the textarea:
.editor .CodeMirror-scroll {
overflow: hidden !important;
}
/* hide the scrollbars */
.editor .CodeMirror-vscrollbar, .editor .CodeMirror-hscrollbar {
display: none !important;
}
JS, where editor is your codemirror instance:
// does not allow focus within codemirror editor:
editor.setOption('readOnly', 'nocursor');
Then you can set your scrollTop() position by another editor if need be.
Issues:
cannot copy from the editor.
when selecting content, moving the mouse up and down will cause scroll. ~ going to look for a fix for this.
Set scrollbarStyle: null which Completely hides the scroll
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
lineNumbers: true,
scrollbarStyle: null
});
I'm also using react-codemirror2, it accepts className prop and preventing scroll can be done via css easily. You should add max-height with height: auto.
<CodeMirror
...
className={isScrollable ? 'disable-scroll' : ''}
/>
// sample css
.disable-scroll .CodeMirror {
max-height: 10rem;
height: auto;
}

how to center align the submit and cancel buttons on the editgridrow popup screen

I am using jqgrids editgridrow function to add/edit records.How do I position the submit and cancel button on the popup to center and how do i reduce the fontsize of the labels in the popup.I couldnot find a way to do this as there are no inbuilt properties for this and I donot intend to use custom dialog box. Does anyone know a workaround?
Thanks,
Anita
If you don't use direction: "rtl" option in jqGrid then usage of CSS
.ui-jqdialog-content td.EditButton { text-align: center }
should solve the problem. See the demo which displays
I don't understand why you should reduce the fontsize of the labels. The font used per default in jqGrid is already very small on my taste. Nevertheless the CSS style like
.ui-jqdialog .ui-jqdialog-content .CaptionTD { font-size: 8px }
could be used. See the next demo which displays

How do you prevent hidden (overflow) elements from being rendered?

I have an absolute positioned div off the side of the page with just a bit sticking in. I have applied overflow: hidden to html and the parent div, which gets rid of the scroll bar, but people can still use the middle mouse button to move the page across.
Is there a way to prevent anything that overflows from actually being rendered on the page or simply prohibit middle mouse scrolling?
maybe you need to set overwflow-x and overflow-y, like this:
.class {
overflow-x: hidden;
overflow-y: hidden;
}
if it's not help add some !importanta to this style.

Disable slickgrid horizontal scrollbar

I need to disable slickgrid horizontal scrollbar. I have only one column and have forceFitColumns : true.
Is possible?
Thanks
You can do this with a little css. Try adding this to your page.
.slick-viewport {
overflow-x: hidden !important;
}
Note that the !important is important because the style gets inlined by the grid code so this overrides it...
HTH

Page jumps to the top when checkbox is clicked

I'm calling handleNotableTypeSelect method on the click of the check box, everything is working fine but the page jumps to the top.
this.$hideInactiveCheckbox.click(
this.handleNotableTypeSelect.createDelegate(this));
handleNotableTypeSelect: function(e) {
//e.preventDefault();
if (this.$hideInactiveCheckbox.attr('checked')) {
this.isActive = "^active$";
this.$connTable.fnFilter(this.isActive, 1,true);
}
else {
this.$connTable.fnFilter('', 1);
}
//return false;
}
My case was that the checkbox was hidden (due to CSS design). the original input checkbox had position set to 'absolute' so when the user clicked the checkbox the page "jumped" to the real checkbox position.
EDIT:
In some cases there are styled "fake" checkboxes. the real checkbox element is hidden in some bad practice way.
My case was that the real checkbox element had absolute positioning and hidden and that cause the page jump to top of the window.
Possible solution:
Check if the checkbox element has the following CSS rule
position: absolute;
if yes, removing this rule can fix this issue.
This may related to the following issue:
input checkbox in div jumps to top of page on firefox
I've actually been seeing errors about this in all kinds of frameworks, and for the most part, people post framework specific answers. If you're hiding the check box, try using display: none on it, it seemed to work for the post above. I'm still trying to hunt down a fix (since I'm not hiding my checkboxes, I'm trying figure out why checkboxes in a modal cause the screen to jump to the top of the modal on click).
Several frameworks and css tricks hide the checkbox using position: absolute.
That is correct because we need to hide the checkbox only from screen, while Screen Readers must have access to it in order to announce it correctly. But display:none hides it from them too and users with accessibility issues can't click it.
The most suitable solution is to add position:relative to checkbox container and adjust checkbox position using top: if needed.
If your check box has position: absolute, in most cases just wrapping it (input and label elements) with a div should be enough.
If the checkbox has been positioned absolute to hide it and the interaction occurs on the label (which is commonplace when styling checkboxes beyond the default UI), the page will scroll to wherever the checkbox input is positioned despite the click event occurring on the label. so if you've added top:-9999px; for example, the page will jump right up to where it's now positioned.
What you want instead, is to remove it from the rendered layout without moving it away from the label. to do this, add a container div to the label and input, and add position:relative; to it. Then add the following code to the input itself:
position:absolute;
top:0; left:0;
visibility: hidden;
opacity: 0;

Resources