Radio buttons acts as Check-box in TinyMce 4 - tinymce

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

Related

Forest Admin Smart Action field multiline (Textarea)

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
}],
}]

How to select the forst item of w2ui list field

I have a w2ui form with this list field:
...
{ field: 'field_module', type: 'list', required: true,
html: { caption: 'Program', attr: 'size="14"', span: 3 }},
...
Once I have loaded the items via ajax (that works fine) I would like to preselect the first item of that list.
How to achieve this?
I've found the answer.
Quite easy, even if I couldn't find out how to select the first item numerically
form.record.field_module = {id: '--ALL--', text: '--ALL--'};

Autoform bootstrap themes

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?

how to hide / show ionic popup buttons dynamically

I am on my first big ionic project and am stuck. Would someone have an idea how to dynamically hide and show buttons in an ionic popup? I need the buttons to initially be hidden, but then after something happens the buttons should show up. Any idea how to get that done?
Trying to explain further, what is required here is provide angular directives inside of the $ionicPopup buttons. eg
buttons: [{
text: 'Cancel'
}, {
text: '<b ng-disabled="user.length<1">Delete</b>',
type: 'button-crimson'
}]
But ng-disabled="user.length<1" gets trimmed when the pop-up is rendered.
If you're still looking for an answer to this...
I created a variable for my buttons array
var buttons = [{...}, {...}]
Then would assign that to the object in the popup
$ionicPopup.show({
templateUrl: 'templates/pop-up.html',
title: 'My Popup',
subTitle: 'stuff,
scope: $scope,
**buttons: buttons,**
And then would alter that array
buttons.splice(0, 1, {/*new button*/})
I haven't tested it but it might also work if you wanted to edit a title or class
buttons[0].type = 'newCssClass';
My work-around has been to put the dynamic buttons in the template of the popup rather than the buttons array. It's not ideal but it will work.
eg:
addPopup = $ionicPopup.show({
templateUrl: 'templates/pop-up.html',
title: 'My Popup',
subTitle: 'stuff,
scope: $scope,
buttons: [{
text: 'Cancel',
And then in pop-up.html you can do your usual angular ng-if/ng-hide/ng-disabled/etc stuff like normal. The downside is that those buttons wont show up along the bottom where the ones in the array go, but with some styling work you can make it still look nice.
It should be easy using $scope variables and ng-hide/ng-show
function something_happens(){
$scope.it_happened = true;
}
<button ng-show="it_happened">Qlik Me</button>
The button will only display if $scope.it_happened == true

how to make simple paging extjs4

Good day everyone, I'm new user to Extjs 4. Right now, I have a problem in creating a simple paging (a test run just to familiarized on this). Please take a look at the example below.
//creating a store data first
var itemsPerPage = 2;
var productivity = Ext.create('Ext.data.Store',{
fields : ['name','aht','numberOfCalls'],
pageSize: itemsPerPage,
autoLoad: true,
data:{'items':[
{name: 'Magelyn Cunanan', aht:'6:00', numberOfCalls:'50'},
{name:'Martin Dejaresco', aht:'7:30', numberOfCalls:'40'},
{name:'Emerson Dela Pena', aht:'8:00', numberOfCalls:'45'}
]},
proxy: {
type: 'ajax',
url: 'pagingstore.js',
reader: {
type: 'json',
root: 'items',
totalProperty:'total'
}
}
});
productivity.load({
params:{
start:0,
limit: itemsPerPage
}
});
then on my paging,
//... some code here. by the way this is a viewport container
region: 'center',
xtype: 'tabpanel',
autoScroll: true,
activeTab: 2,
items: [{
title: 'Agent\'s Productivity',
xtype: 'gridpanel',
store: productivity,
//for flex, indicates the amount of space this component will take up in its parent container. eg. if 1 this will take 100% of the container
columns: [
{text: 'Agent name',dataIndex: 'name', flex: 1},
{text: 'Handling Time',dataIndex:'aht',flex:1},
{text: 'Number of calls' ,dataIndex: 'numberOfCalls',flex:1}
],
dockedItems:[{
xtype: 'pagingtoolbar',
store: productivity,
dock: 'bottom',
displayInfo: true
}],
all of these codes that I mentioned earlier are inside in app.js. The problem is when I run the program. The data that I stored doesn't appeared on the grid. It shows only no results plus 0 displays on the dockedItems.. I'm using this just to familiarize on how the extjs works and I need to use this extjs for my programming project in the future.
your answer and explanations to your answer is highly appreciated :)
thank you
What is apparent from your code:
you use inline data plus ajax proxy. These two are mutually exclusive - you either want some inline data or you want to pull data from a server via ajax.
proxy url points to a file (at least I guess it from the name pagingstore.js. This is not going to work as server side has to honor start and limit parameters, it has to return only matching recors and it has to return total number of records for paging to work.
you must never fiddle with start and limit yourself when loading the store. Store already knows what to do and sends these parameters automatically.
For inline paging just need to code this
pageSize: itemsPerPage
proxy: {
type: 'memory',
enablePaging: true
}
oh boy.. I made myself difficult on this one :) but thanks for the reference