ExtJS: Making an image as a column header - extjs

Is it possible in ExtJS 4.0 to set a column header as a image, or custom rendered HTML?

The API for column text says:
text : String
The header text to be used as innerHTML (html tags are
accepted) to display in the Grid.
Which means you can pass in something like <span class="mySpan"></span> and define a css class that has a background image.
EDIT:
Here is an example:
http://jsfiddle.net/HSVj8/102/

Related

How to extend the Wagtail image format modal?

We have a use case where a content editor wants to
right-align an image so text wraps around it and
set the image width so it will scale well in an article.
While the rich text editor allows us to select an image with a right-aligned format, there isn't an option for specifying the image width.
How can I customize the Wagtail "Choose a format" modal to add a new field for image width and use that in the rendered output? I hope to avoid creating additional image formats with possible permutations of image alignment/width since these are two separate properties.
Prior art
See the WordPress Gutenberg image settings UI below for prior art.
Docs: https://docs.wagtail.org/en/stable/advanced_topics/images/changing_rich_text_representation.html#changing-rich-text-representation
# image_formats.py
from wagtail.images.formats import Format, register_image_format
class SubclassedImageFormat(Format):
def image_to_html(self, image, alt_text, extra_attributes=None):
original_html = super().image_to_html(image, alt_text, extra_attributes)
return original_html.replace('class="', 'class="foo')
register_image_format(
SubclassedImageFormat('subclassed_format', 'Subclassed Format', classnames, filter_spec)
)

Displaying Quill editor content with correct style

I am using the Quill editor (via ngx-quill) to give my user the ability to edit documents. When the documents are displayed I show them like this:
<div [innerHTML]="doc.text"></div>
This works reliably, but the styling of the content of the div tag is quite different from what you see in the Quill editor window. What I want to do is apply the Quill content stylesheet to my div tag, but I haven't been able to find any document to do that. Does anyone here know how to do that?
I know one alternative is to invoke a Quill editor in read-only mode and without a tool-bar. That's my fall-back but I would prefer not to do that.
I was facing the same issue. Some inline styles are displayed, but the styles applied from the Quill.js class are not applied. post-content is class of div containing the content:
let content=document.querySelector('.post-content')
content.innerHTML=content.innerText

Quill editor - HTML controls on Quill text area

I am trying to build a text editor for my application using react quill. My requirement is to build a sentence template and in that template, there will be some HTML controls like some free texts and some dropdown options. Is it possible to build an editor like this using Quill. Basically, instead of toolbars, I want that toolbar like options in the text editor area.
Eg:
Template 1 - I have {select option} brothers
Template 2 - My name is {input box}
In the first template, the number is a selectable item, and in the second example, the name is a free text. There are some validations on these items. that need to cover separately.
Is it possible to fulfil this requirement using Quill editor?

Can i get applied style Object of editor-text in textangular

i want to save textangular editor's text with styles and tags (applied by its toolbar) in DB.
Is there a way i can do this without saving HTML ?
Currently i am saving html with decoding.

How to display an image inside an ng-grid

I'm using ng-grid to create a table in which one of the columns is an image column. Each image cell will get it's image from ng-src. At the end of the URL, there will be a specific identifier. Here is the part of the directive for the cell template that sets the text of the image. The 'image caption' is not appearing. Just getting row.getProperty('imageCaption').
attrs.$set('ngSrc',
"http://dummyimage.com/60x40/FFF/000&text=row.getProperty('imageCaption')");
Here is the plunkr
I don't think you should need a directive here, you can set your ng-src inside your imagetemplate.html, like so:
<img ng-src="http://dummyimage.com/60x40/FFF/000&text={{row.getProperty('imageCaption')}}" lazy-src >
Here is revised plnkr:
http://plnkr.co/edit/Bh1LKHRUXHpJa4KEUtA7?p=preview

Resources