I need example about Ext.draw.engine.ImageExporter - extjs4.1

I want to export Ext Chart using type SVG. But i dont understand it.
Could you give me a example about Ext.draw.engine.ImageExporter (Ext 4.1)
Thank for helping
Nguyen

A working example that uses the ImageExporter:
http://dev.sencha.com/deploy/ext-4.1.0-gpl/examples/charts/Area.html

Related

Fishbase-API get-query

I would like to use the Fishbase-API in my app.
https://fishbase.ropensci.org/
here is the README for the API...
https://fishbaseapi.readme.io/reference/getting-started
But I don't know how to create a correct query to search for certain “common names” (comnames) and get a list of results?
Thanks a lot!

Minecraft Spigot I cannot get String from Component

Hello Support I can't get the String from a Component. I did this with 2 ways with bad results.
TextComponent textComponent = (TextComponent) item.displayname;
return textComponent.content();
The result of this is a error with Casting
and
return PlainTextComponentSerializer.plainText().serialize(item.displayname);
The result of this is Literaly "chat.square_brackets" which is weird.
Please Help. Thanks
I also was having trouble with this. Here's what I found to work for me. Full disclosure that I'm developing my plugin on the PaperMC 1.16 fork and not Spigot. So it's possible that this may not work for you, either because it isn't a part of Spigot or because you are working in a version that this feature is not a part of.
To start, I would first check to make sure that we are both on the same page. For me, the component objects being used are from a package called net.kyori.adventure.text if yours are not provided by this package I don't know that this solution will work for you.
Also as mentioned by others, accessing the displayName directly on the ItemStack isn't going to give the desired results. Instead, you need to do itemStack.getItemMeta().displayName(). This method should then return a net.kyori.adventure.text.Component; once you have the component you need to serialize it using one of the serializers from the previously mentioned package.
That will look something like this:
Component itemDisplayName = itemStack.getItemMeta().displayName()
PlainComponentSerializer plainSerializer = PlainComponentSerializer.plain();
String itemName = plainSerializer.serialize(itemDisplayName);
The package that the serializer is from is: net.kyori.adventure.text.serializer.plain.PlainComponentSerializer
I don't understand how you can access to the displayname field in ItemStack in the Spigot API.
You should use ItemMeta to manage display name. To get the item meta, you should use ItemStack#getItemMeta.
Don't forget to check if the item as a meta with hasItemMeta. You can also use hasDisplayName to be sure that the display name is valid.

Is using Javascript in odoo.fields.HTML possible?

I want to integrate Adobe Captivate Content (Export: index.html, along with src-folder) into ODOO Community Edition v13 e-Learning Module (website_slides).
The slide.slide model already offers slide_type 'webpage' alongside the field 'html_content'.
The field 'html_content' is of type odoo.fields.HTML. To get the requirement stated above to work, I need to embed Javascript in the given html_content. It seems like the JS-scripts are not working. I also tried with a simple Hello World script.
Can someone help?
Best regards,
Lars
I found the solution already.
Looking at odoo/fields.py -> class Html, you can see that by default the given value is being sanitized using odoo/tools/mail.py -> html_sanitize(), which removes the HTML-Elements in 'tags_to_kill'. 'tags_to_kill' also contains "script".
After overriding html_content in slide.slide with the following, the Javascript-code is being executed:
html_content = fields.Html(
sanitize=False,
sanitize_tags=False,
sanitize_attributes=False)

How can I apply DragFlickBehavior in code?

How can I apply the win8nl DragFlickBehavior for a grid in code behind?
Any help will really appreciated.
Thanks in advance
I got the solution
Win8nl.Behaviors.DragFlickBehavior behaviour = new DragFlickBehavior();
WinRtBehaviors.Interaction.GetBehaviors(grdNew).Add(behaviour);
Behaviours are currently not supported on Win8Dev. Have a look at
http://winrtbehaviors.codeplex.com/
This post by the author shows how to use implement it
http://dotnetbyexample.blogspot.co.uk/2012/03/attached-behaviors-for-windows-8-metro.html

theming price format in drupal ubercart

What I am trying to achieve is to theme the price format the following way. I only want to remove the decimals when they are 00.
For example €5,00 should be €5, but €5,50 should remain the same, not €5,5.
I found a forum about this problem but I dont know how to implement it, especially overriding theme_uc_product_price() as suggested here.
Those links suggest using either the Computed Field Module or a Preprocess function but it would be simple with a bit of JQuery:
Let's say you have a div like so:
<div class="field-price">€ 5,00</div>
You could then target that element with a replace:
$('.field-price:contains(",00")').html(function(i, h) {
return h.replace(/00/g, '');
});​
I wrote a demo here:
http://jsfiddle.net/JySHQ/1/
Note please indicate what version of Drupal you have and then I give give you some hints as how to implement as Javascript is different in Drupal 6 vs. Drupal 7