I'm using aldeed's autoform, simpleschema and collection2. I am looking to change the way the radio buttons / check boxes look. I've read through the documentation but am unable to find how to incorporate different ways how the buttons are visually rendered. On the GIT issue page, I read through how to implement custom class in the schema itself. Example:
"type":{
type: String,
autoform:{
type: "select-radio-inline",
class: "radio-primary",
options: function(){
return [
{label: "Well Known", value: "well-known"},
{label: "Basic", value: "basic"},
{label: "Extended", value: "extended"}
];
},
But somehow it does not change the look of the default radio buttons. Is there a workaround for this?
Related
Is there any solution to use an input value of type Textarea on Forest Admin Smart Action form ? I would like render a field like this :
Documentation said there is only Boolean, Date, Dateonly, Enum, File, Number, String types but use a multiline is a common use case, isn't it ?
Thanks for your help
You can use the widget parameter when configuring your input fields on your Smart Action. Here is an example:
collection('customers', {
actions: [{
name: 'Charge credit card',
fields: [{
field: 'description',
type: 'String',
widget: 'text area', // <-- set the widget text area
}],
}]
I've had a request form a client to have the following chart replicated in HighCharts cloud, but I'm having difficulty figuring out how to make the first series show as a "floating gray bar" - or whatever it's called. Any suggestions on how I could achieve to this?
You can use columnrange series type to add the 'floating bar':
series: [{
type: 'column',
data: [...]
}, {
type: 'columnrange',
data: [...]
}]
Live demo: https://jsfiddle.net/BlackLabel/ys1x79uk/
API Reference: https://api.highcharts.com/highcharts/series.columnrange.data
Here's the fiddle, the type is radio but acts like check-box
{type: 'radio', name: 'letter', label: 'Letter'},
{type: 'radio', name: 'custom', label: 'Custom'},
I tried using them under one name that didn't work out, and my 2nd question: how to make one of them as default(as selected).
Keep Smiling :)
It seems like the tinymce/ui/Radio class is not implemented yet. It act like a tinymce/ui/Checkbox.
You can use the tinymce/ui/ListBox class as a workaround.
for the 2nd question: {type: 'radio', name: 'a', label: 'Letter', checked:'checked'}
Radio - not implemented yet
See message here: https://github.com/tinymce/tinymce/blob/ca0f454b9001b9f20aa26349b25f6d839c1a1146/js/tinymce/skins/lightgray/Radio.less
and almost empty class Radio.js
https://github.com/tinymce/tinymce/blob/0ab3af181284a060683b566d50e81381cc6445a9/js/tinymce/classes/ui/Radio.js
Let's say I have multiple nested panels (plain ones, not form.Panel) containing form fields.
The user can copy such a panel and its fields to a different panel.
I somehow need to add those newly created fields to a main formpanel so they get submitted, but don't know how.
I can't do
formpanel.add(fields)
because then they're rendered to the formpanel's body and not the panel they were in in the first place. Setting the fields' renderTo property doesn't help either.
So basically I need a way of adding a field to a normal panel (or any other component for that matter), but also adding it to a specific formpanel so its values are submitted on form submit.
Has anyone done this or could at least point me in the right direction?
You can wrap all your panels inside one form panel and all the fields inside will be submitted. I did this way with accordeons, tabpanel and normal panels deeply nested inside each other. Example:
var form = Ext.create('Ext.form.Panel', {
// form attributes goes here...
// ...
initComponent: function(){
// all your panels goes here.
this.items = [
{
xtype:'panel',
title: 'First panel',
layout: 'anchor',
frame: true,
defaults: {anchor: '100%'},
items: [
{xtype:'textfield', name: 'foo',fieldLabel: 'Foo'},
{xtype:'textfield', name: 'foo',fieldLabel: 'Bar'}
]
},
{
xtype:'panel',
title: 'Second panel',
layout: 'anchor',
frame: true,
defaults: {anchor: '100%'},
items: [
{xtype:'textfield', name: 'baz',fieldLabel: 'Baz'},
{
xtype: 'panel',
items: [/* another set of fields */]
}
]
},
];
this.buttons = [/* ... your buttons here ...*/];
this.callParent(arguments);
}
});
I have looked everywhere and I can't figure out how to add another option to tinyMCE's drop-down for formatting. I would like to duplicate and modify the formatting for the pre tag to also give it a class of .prettyprint so that I can quickly add code snippets to my posts.
It should be technically possible, but how and which file should I amend. Alternatively can I add a button that applies this formatting
You may add something like the following (style_fomats setting) to your tinymce init function in order to add a new option to the styles dropdown. Be aware that the class to be applied should be made available using the content_css configuration setting
style_formats: [{
title: 'block styles'
}, {
title: 'Name_to_be_displayed',
block: 'p',
classes: 'class_to_be_applied',
exact: true
}, {
title: 'inline styles'
}, {
title: 'Red text',
inline: 'span',
classes: 'red',
exact: true
}, {
title: 'Pre formatting',
inline: 'pre',
classes: 'xyzpre',
exact: true
}],
Alternatively can I add a button that
applies this formatting
Yes, you will need to write your own plugin, which is not that difficult.