pdfmake-wrapper how to write a line with multiple style - pdfmake

I'm trying this library which is a wrapper of pdfmake and I can't find how to make multiple styles inline, such as this example:
I've been struggling on this for a while.

So I just found the answer to my question:
new Txt([
new Txt('I\'ve been struggling').bold().end,
' on this for a',
new Txt('while').italics().end
]).end

Related

Localization Behavior simply not working

I'm trying to test the localization feature in Polymer.
I've created a new App using the new CLI.
It gives you a nice scaffolding of an app. In there I've added the code from the app-localize-behavior docs to enable it but it simply doesn't work. By doesn't work I mean that the {{localize(...)}} line doesn't show anything.
You can find my sample code in the link below:
https://gist.github.com/dallarosa/daaac2d8959026a05c1eef1d65493d6b
This is really just the scaffolding plus the entries related to app-localize-behavior, so in the gist I've only added the related code. Let me know if you actually wanna see the whole contents.
I just very quickly looked at the issue, and it looks ok to me at first glance... except for possibly requiring to 'type' your language property:
language: {type: String, value: 'en'}

cakephp highchart fatal error while rendering

Here I am, again. With another question concerning cakephp-2.5 and the plugin 'highcharts'.
I've been looking at the demo's an all the different things I could find were the extendings from the controllers. But... that isn't required because it's a plug, am I right?
So, I have included th plugin to my loadings inside the bootstrap file, and when I'm trying to render my HighChart I'm receiving the following error;
Error: Chart: "1" could not be found. Ensure that Chart Name is the same string that is passed to $this->HighCharts->render() in your view.
But the demos are working fine! Any idea what I f*cked up? The names are the same, I even renamed them to 'asd' ( both! ) and it still doesn't work. ^^"
I know this is an incredibly late response but for the benefit of those still experiencing problems with this, the CakePHP 2.* Highcharts plugin has been updated and is compatible up to CakePHP version 2.5.7.
Do note however that in order to maintain product name consistency throughout the repo, all previous references to "HighCharts" have been changed to "Highcharts" and "high_charts" is now simply "highcharts" . So for eg. you now have to call $this->Highcharts->render() where before you would have used $this->HighCharts->render().
The plugin was not yet compatible with CakePHP 2.5. Right now as we speak the developer is working on a new release for 2.5. :)
In CakePHP 2.5, you can avoid the error above and render your chart by calling it.
For example from within index() within your controller, use:
$this->bar();
In this example, bar() is the name of the function containing your chart.

ZF2 BBCode Parser

Hiho,
I use the ckeditor on my website for special textareas like forum
or signatures.
But I have a problem with the output. I use ZF2 and would like to
use ZendMarkup to render the output bbcode back in html.
But at every time I call
$bbcode->render(...)
I got the error
There is no Zend_Markup_Root markup.
The ZendMarkup is an extension inspired by the Zend_Markup from ZF1.
But I can't find any thing on API or other guides.
Does someone has any idea what as the problem is?
The ZendMarkup library is very old (last update is 10 months ago!) so I wouldn't use such library. If you would like, I think I traced the error down.
On this line there is a reference to Zend_Markup_Root while that should be ZendMarkup\Renderer\Markup\Html\Root. Try to change that line and see what happens.
Another way is to replace the ZendMarkup library with another library which does work and is updated regularly. An example is Decoda. If you load mjohnson/decoda in your composer.json, you can use Decoda in your Zend Framework 2 application:
<?php
use Decoda\Decoda;
$parser = new Decoda($bbcode);
$html = $parser->parse();
With tools like composer, there is no need to use solely Zend* components when there are better alternatives.

Can I add Dart Web UI bindings to DOM elements created in code?

In the Dart Web UI package, it is possible to create bindings using the {{}} or bind-value syntax. Is this also possible, when DOM elements are created in code?
Something like
new Element.html('<div>Value: {{str}}</div>');
and
new Element.html('<input type="text" bind-value="str">');
binding an event to str, without manually piecing the strings together?
Note: this question was asked earlier today, but was deleted before it was answered, but I wanted to know the answer, so I'm reposting it.
Quick answer, no.
The bindings need to be processed by the dwc transformer, which converts Web Components and MDV code into "vanilla" Dart and HTML (suitable for compilation to "vanilla" JavaScript).
Generally, you should use <template> tags to instantiate new elements.
An alternative is to wrap these bits of text inside a custom element, which you can transform with dwc and instantiate manually.

GXT 3.x Custom PropertyEditor / ValueBaseInputCell

I'm trying to write a custom field editor that will translate between Long and String. IE: String representation on screen but field type is a Long.
I've implemented the PropertyEditor (HrMinPropertyEditor) but don't know how to wire it in. My HrMinField is quite clunky as I needed to use a TriggerFieldCell because the generic types inside TextInputCell etc. prevented me from using them.
Do I need to do a subclass of ValueBaseInputCell? That seems strange since my PropertyEditor has all the Long / String conversions. It also looks difficult.
If so, is there a simple example or some documentation I can read?
BTW, my learning project is Maven based and should be easy to fire up if necessary:
svn checkout http://subversion.assembla.com/svn/freshcode_public/learn/gwt/ learn-gwt
cd learn-gwt
mvn gwt:run
Navigate to GXT | Forms | Time Edit
Thanks in advance,
Pete
PS: I've asked this on the Sencha forum too.
You should use method setPropertyEditor from Field class to specify your custom property editor:
HrMinField f = new HrMinField();
f.setPropertyEditor( new HrMinPropertyEditor() );
I managed to come up with a solution using a Converter and a Validator.
The more complete answer is on the Sencha thread.

Resources