how do i set variable in toolbar_sticky_offset option of tiny editor - tinymce

i'm using vue2 with #vue/composition-api
in some reason i have to use display:none to component that have tinyEditor.
The problem arises when i disabled display:none. tinyEditor not deleted but just disappearing so when i scrolling, event still work in tinyEditor.
so 'tox-tinymce--toolbar-sticky-on' <- keep stick to tinyEditor.
i've tried use computed to option, watched params(the variable value is params) and add variable class none of them work. obviously my approach doesn't effect to tinyEditor.
how do i set some variable value in toolbar_sticky_offset option?

Related

How to make TextMeshPro Input Field work in layout?

I'm having odd issues trying to use Unity's Text Mesh Pro Input Field UI element. I don't actually know if the layout is causing it though.
I have a scroll view which uses a vertical layout to organize objects under the content object. Each object in the scroll view has a horizontal layout inside it which fits two input fields next to one another so essentially the Scroll view has two columns of input fields.
However I'm getting odd behavior from the input field. When I start typing it won't show the input until I've entered two characters (i.e. I type '0' and it shows nothing then I type another '0' and it will show '00'). Additionally I have some code that automatically populates the input field with default value, below is an example of how I do this:
gameObject.GetComponent<TMP_InputField>().text = numVal.ToString();
However the values never show up, but I can confirm that they are being populated by checking the inspector window while the game is running. Under the TMP_Input Field component, the 'Text' field shows the correct value but I can't see it in the input box.
I'm getting no errors or warnings.
Is it the scroll view or the layered layouts that are confusing the Input Field's script? Something else? Any advice, help, and questions are appreciated.
EDIT:
I've found that it may have something to do with the way the objects are added to the scroll view. The content of the scroll view (which has the vertical layout) get's objects added to it during run time. This is done through instantiating a prefab.
Instantiate(DoubleInputNodePrefab, contentObject.transform);
This prefab object has the horizontal layout and two children, each an input field. If I add this prefab to content window before I run the game it works fine (expect that none of my intended code works since it relies on modularly adding and removing these objects) but I can give input and it looks fine.
WORK AROUND:
I won't consider this a solution but it is a work around I'm going with for now. Using a 'normal' input field rather than a Text Mesh Pro one doesn't create the same issues and works as intended.

pugjs - radio button checked attribute as variable

Working on a pugjs mixin. Creating radio buttons in a loop over json. Normal name-value pairs are work as expected. In the loop, setting a radio button to checked by default is fine. Trying to figure out how to not set the checked value for non-selected radio buttons.
I can do this with javascript but seems like I should be able to do this in pug.
Tried setting a variable
-checked =(!fVar.checked)?'checked':''
and then use in tag
input(type='radio' #{checked})
Is there a way to do this in pug?
Figured out one way. Not as direct as I would like but I nested mixins.
The main mixin has a case statement that calls child mixins.
case fVar.checked
when 'true'
+radioChecked()
when 'false'
+radioUnchecked()
Not very D.R.Y. but it works.

angular2 formcontrol stays dirty even if set to original value

When I change a value in an input field, the corresponding form-control is set to dirty. When I revert my change (by typing in the input field) the form-control stays dirty. Is this intended, is this a bug or do I do something wrong?
Well, yes it's intended to work that way since:
A control is dirty if the user has changed the value in the UI. (docs entry)
..and not if the value is different from the starting value.
In case you want to revert the dirty state you could use the markAsPristine() (docs entry) on your AbstractControl. (eg trigger it by click on a button or when subscribing to the valueChanges observable of the AbstractControl and compare the new value to a previously stored one...)

Modify an ag-grid row after rendering

I need to slightly modify a ag-grid row after it has been rendered. In ag-grid, the actual HTML elements are not necessarily persistent, so manually-set styles may fall off.
For one thing, I have to modify the selection checkbox to set its tabindex to -1. This can technically be done in the cellRenderer callback, although it looks quite hacky. (The checkbox can be found at params.eGridCell.children[0].children[0].wrappedElement.)
But I also have to add a CSS class to some rows to highlight them based on external criteria. I haven't found a way to do this at all.
The best solution would seem to be using some sort of after-rendering callback, but to my knowledge no such thing exists.
I found a couple of related questions, but they were both resolved via cellStyle, which would not suffice here:
Row formatting in ag-Grid
How to provide a background color for an entire row in ag grid based on a certain value in a column?
You have not 1 but 3 options:
getRowClass(params):
Callback version of property 'rowClass'. Function should return a string or an array of strings.
getRowStyle(params):
Callback version of property 'rowStyle'. Function should return an object of CSS values.
processRowPostCreate(params):
Allows you to process rows after they are created. So do final adding of custom attributes etc.
In this last one you have the row in params.eRow.
All taken from https://www.ag-grid.com/javascript-grid-callbacks/index.php

wicket: Dropdownchoice

i have two dropdowns using same model and sets the value into it. Dropdown1 will visible on screen always and Dropdown2, will be visible for only one particular option choosen in Dropdown1. and i am making an query to the DB based on the selections in dropdowns.
But when i have both the dropdown first and then hide the second one, The value already set but the Dropdown2 is still avalible in my model, and making my query to fetch improper data.
So can any one suggest me an idea, how to set the value to null for the attribute which is actually set but dropdown2, if dropdown2 is inVisible.
(i tried to set the ModelObject to null, when making the dropdown2 invisible (using AjaxFormComponentupdateBehavior), but when i make the dropdown2, visible again, it returns null,even if i make any selection in it)
Are you using a LoadableDetachableModel ? try to explicitly detach model from that dropdown on setHide event. I did not try it though.