Aframe: How to set an entity class with js? - aframe

i'm adding aframe entities programmatically.
I didn't find how to set their class so that they get raycaster events.
i tried this without succes:
this.el.setAttribute('class', 'link');
or:
this.el.className = "link";

From the docs (I'm linking MDN, for this is not aframe exclusive):
Add a class using
this.el.classList.add("myClass");
Remove it using
this.el.classList.remove("myClass");
You can check out this fiddle where i add/remove classes to set which objects are clickable. Here with a mouse-cursor instead of the classic one.

Related

example to add custom properties in qt using QDesignerDynamicPropertySheetExtension class

I need to define new property using QDesignerDynamicPropertySheetExtension class, it would be helpful if anyone share the example for this

FullCalendar does not apply css on changeView in Vaadin framework

I'm building a calendar plugin for Vaadin (see https://vaadin.com/). Everythng works fine, the stylesheets are applied EXCEPT when I programatically change the view. The view changes but the Fullcalendar styles do not apply correctly! See sample screenshot.List View after changeView called
I need to hit refresh for the styles to apply correctly.
(If I just change the view using the full calendar 'built in' buttons at the top right, the styles are applied.)
Using FullCalendar V3.7.0 and and Scheduler trial 1.9.0
Vaadin is a GWT framework, using V6.8.
GWT code for calling changeView:
private native void changeView(JavaScriptObject cal,String view,String nid)
/*-{
cal.fullCalendar("changeView",view);
//cal.trigger( "create" ); trying to fix the not-applying .css problem
}-*/;
'cal' is the original selector returned by jQuery.
Any ideas how to fix this?
Found the problem. It was due to the Vaadin framework removing FC's style class from the topmost element. To fix, I simply added these back using the framework's setStyleName("fc fc-unthemed fc-ltr");.

How to get gwt widget default stylename

In gwt how to get a widget's default style(CSS Selector).For example, gwt button has style name "gwt-button" which is referenced in gwt theme css file.
How to got that programmatically.
Is there any,
DOM.getStyleAttribute();
to accomplish this. GWT experts please help.
In your example of button (or any object that is a child of UIObject) can call getStyleName()
UIObject documentation
String com.google.gwt.user.client.ui.UIObject.getStyleName()
Gets all of the object's style names, as a space-separated list. If you wish to retrieve only the primary style name, call getStylePrimaryName().
Now as to why you need this information is the real question. It is my guess that you want to change the styling of an object (add or remove). This would best be done by either of the following methods.
1) Supplying a custom resources file to the object that has your styling
2) creating a class that extends Composite and create a custom UIBinder class with all of your styles within it.

How to bind property of View to property of class using Flex MATE

Lately i discovered MATE (for Flex development) and was wondering: how do i bind a property in a view (actually a navigatorcontent component) to another property in a class so that they stay in synchronization (meaning that whenever the property in the class changes the property in the view also changes).
So if we have a view called Target.mxml and a property targertProp how do we bind it to the class called SourceClass with property SourceProp?
Thanks in advance
For future use:
fiction has answered the question correctly.
Actually it should have been formulated this way!
<Injectors target="{Target}">
<PropertyInjector targetKey="targertProp"
source="{SourceClass}"
sourceKey="SourceProp"/>
</Injectors>
Of course SourceProp must be [Bindable]
Read my article below
http://vinothbabu.com/2010/03/21/introduction-to-mate-framework/
on how you use the Injectors Tag to play with. Its a very simple example. Let me if you were looking for something else.

MvcConrib Grid's Sortable property don't seems to to do any effect

I need a way to generate the header texts in the grid as sortalbe link.
Do I need to use custom renderer to get this behavior?
You need to use GridSortOptions and call the .Sort(YourModel.GridSortOptions) method on the grid and then handle the OrderBy in your controller action.
See this link: http://www.jeremyskinner.co.uk/2010/03/14/mvccontrib-grid-part-6-sorting/
Thanks,
Hal

Resources