i tried to use this.Dispatcher in a added class in Windows Phone i get the error " does not contain a defenition for Dispatcher...".
How can i solve this Problem?
Thanks!
You could use this snippet :
SynchronizationContext cont = SynchronizationContext.Current;
cont.Post((foo) => {}, null );
Hope this helps you.
I have find a other Solution!!
If u add :PhoneApplicationPage to ur class. , in my Exampel: public class savelist: PhoneApplicationPage, than will Dispatcher work
For Silverlight-based apps, you can use Deployment.Current.Dispatcher from any context.
Related
I cannot access any value in typescript inside the function triggered by the onAdd event of the dxo-item-dragging element. All come undefined
HTML Code :
<dxo-item-dragging group="'server'" [data]="tasks"
[allowReordering]="true" [onDragStart]="onDragStart" [onAdd]="onAdd" [onRemove]="onRemove">
</dxo-item-dragging>
TS Code:
onAdd(e) {
e.toData.splice(e.toIndex, 0, e.itemData);
let a = this.tasks;
}
When I do let a = this.tasks, this.tasks comes as undefined. Actually I defined it.
When I type [onAdd]="onAdd.bind(this)" instead of [onAdd]="onAdd", I can access all properties, but this time the ui slows down a lot and freezes.
Thanks in advance for your help
I tried binding the event event to a function.
I was expecting to access all properties in that function, but I can't.
in the example in this link https://js.devexpress.com/Demos/WidgetsGallery/Demo/DataGrid/DnDBetweenGrids/Angular/Light/ there is a solution to my problem. For those who have the same problem as me, the solution to my problem is to put
this.onAdd = this.onAdd.bind(this);
It was enough for me to write. Have a nice day
Is it possible to use Cypress to find and delete an element from the HTML? And how to do it?
Edit: This works:
cy.get(selector).then((elem) => {
const elemHtml = elem.get(0)
elemHtml.remove()
})
Variation on #krema's answer:
cy.get(selector).invoke('remove');
get() yields the DOM element(s) it found which can then be removed.
cy.get(selector).then($el => $el.remove());
You can use embedded jquery in cypress:
Cypress.$(yourElementSelector).remove();
I am using PrimeNG. I wrote code for auto-complete as follows
<p-autoComplete name="searchSuggestions" [(ngModel)]="suggestion"
(completeMethod)="searchSuggestions($event)" [suggestions]="searchSuggestionsResult" field="field"></p-autoComplete>
I am clearing suggestion in a method, but not clearing autocomplete input value. It's clearing only if I select from suggestions.
this.suggestion = undefined;
Use onClear() method & set your model values = null.
====HTML
(onClear)="clearValue()
==ts
clearValue()
{
this.suggestion = null;
}
This function will get called only when you are cleared all the values from auto-complete list.
Hope this will work!!
Kindly upgrade your primeng version up to "primeng": "^1.1.1", then this will work as well.
We have a use case where we would like to remove a user's account in our enterprise. As part of the removal process we want to uncolloborate all of the folders the user owns but is sharing with others. I"m able to remove the user successfully but am stuck trying to uncolloborate all of the folders before removing their account. I've tried the following code but it doesn't seem to work. This is the code I'm using
List<BoxCollaboration> collabs = client.getFoldersManager()
.getFolderCollaborations(entry.getId(),
new BoxDefaultRequestObject());
for (BoxCollaboration collab : collabs) {
BoxUser collaboratorid = (BoxUser) collab.getAccessibleBy();
BoxDefaultRequestObject requestObject = new BoxDefaultRequestObject();
requestObject.getRequestExtras().addHeader("As-User", userwhoisgettingremived.getId());
client.getCollaborationsManager().deleteCollaboration(collaboratorid , requestObject);
}
Anyone have a suggestion of what else I can try.
Thanks in advance
Bill.
You don't need to use "As-User" header as now you are not acting as this user. So the code can be:
for (BoxCollaboration collab : collabs) {
String collaboratorid = collab.getId();
client.getCollaborationsManager().deleteCollaboration(collaboratorid , null);
}
OK I fixed this by adding the id of the Collaboration instead of the id of the user associated with the collaboration. so the deleteCollaboration line of code needed to be changed to
client.getCollaborationsManager().deleteCollaboration(collab.getId() , requestObject);
I have this quickBox2d code to add a cricle to the stage:
var ball:QuickObject = sim.addCircle( {skin:skinMc, x:10, y:10, radius:3, density:0 } );
The skinMc contains animations so I want to be able to refer to it like this: skinMc.gotoAndPlay(5); but it says
Type Coercion failed: cannot convert skinMc$ to flash.display.MovieClip.
ball.gotoAndPlay(5); doesn't work either since it's a QuickObject, not an mc...
Any help will be appreciated
Thanks
ball.userData.gotoAndPlay(5);
userData will be a DisplayObject populated by QuickBox2D.
var sim:QuickBox2D = new QuickBox2D
var ball:QuickObject = sim.addCircle( {skin:skinMc, x:10, y:10, radius:3, density:0 } );
//something along these lines
So to reference the object you can use:
sim.gotoAndPlay("5");
im not 100% on what your doin but i installed both packages and created a quick document and it works fine on my machine.
if need be try this link http://www.emanueleferonato.com/2009/08/25/simplify-your-box2d-projects-with-quickbox2d/
if this fails,send me your file or else let me know how you go.