Is there a way to easily apply some extra styling to the cell editor?
The only thing I’m looking for at the moment is a way to add text-align:right to editors of numeric cells.
What is the easiest/best way to do this?
Is there a way to easily apply some extra styling to the cell editor?
The only thing I’m looking for at the moment is a way to add text-align:right to editors of numeric cells.
What is the easiest/best way to do this?
If you need to change style of the cell in the edit mode you may try to use the following css:
.dhx_combo_edit{
font-size: 16pt !important;
}
.dhx_textarea{
font-size: 16pt !important;
}
I don’t think this will give me what I need because this will affect all elements that uses that css class.
What I need is to align the text to the right for numeric cell editors only, not all cell editors.
So that a cell editor of type ‘ed’ will have the input aligned to the left (default) and a cell of type ‘edn’ will have the input aligned to the right.
Any news on this issue?
For setting the align for youe columns please, try to use the setColAlign() method:
docs.dhtmlx.com/api__dhtmlxgrid_setcolalign.html
But as far as I know this function was for setting alignment of the cell value (when not in edit mode) - what I’m looking for is how to set the alignment of the value of the editor (when in edit mode, aka the editor is open/active).
My cell values are already aligned to the right using the function you mention, but as soon as the editor opens/goes active, the value jumps to the left inside the editor… I want it to stay to the right (right to left) in the editor as well.
This is an open/active editor: |_______________|
Like this: |__________1.000| (alight right)
Instead of: |1.000__________| (align left, which appears to be default)
How do I do this in a way that doesn’t apply to all editors but only those I set?
From what I understand, the editor itself is just a simple input element and all I need to do to it is to add style=“text-align:right;” to it to get the result I want. (on-the-fly or to set it for a column in general)
Really nobody can tell me how to get my hands on the input element of the active editor or of any editor for that matter?
Never mind, I found the solution myself now.
this.editor.obj.style.textAlign = "right";