How to change field style in the sanity io user interface? - content-management-system

How can I change a style of a component easy? I just want limit a text-field height in a sanity user inerface.
It is uncomfortable to scroll all the text every time. Where can I write something like that:
{
overflow-y: auto;
height: 200px;
}

From the screenshot provided in the question, it seems you're using rexxars markdown plugin for Sanity. When defining the markdown field in your schema, you have some options to choose from. I'm guessing what you want is a low minimum number of rows and to disable auto grow? E.g.:
export default {
name: 'blogPost',
title: 'Blog Post',
type: 'document',
fields: [
// ... other blogPost fields
{
name: 'body',
title: 'Body',
type: 'markdown',
options: {
minRows: 10,
autoGrow: false
}
}
]
}
If the options you need aren't available, try creating an issue or submit a pull request, proposing the change you need?

I've tried patch-package. Just followed instructions in the package.

Related

Format or styling label in apache echarts markLine

I need format label in the markline. Is possible add image backround, or in general custom styling?.
Is possible draw the markLine over the candles?, because at the moment when the markline goes down, the candles cover the label.
I would like to do something like what is shown this picture:
EDIT:
This is my actual code
m.setOption(
{
series: {
markLine: {
symbol: 'none',
label:
{
position: 'middle',
show: true,
},
lineStyle: {
color: mc,
//type: 'solid'
},
data: [{yAxis: window.wsData[1], name: 'Tiker'}],
position: 'insideStartTop'
}
}
}
)
This labels has limit to improve deep custom design. By my opinion it's right decision because many developers don't understand design and other people will frustrate due incorrect style, color, position... But we are developers and no one can interfere with our love for real art, hehe )
Try to implement this options: https://stackoverflow.com/a/64875984/1597964

How to give vertical height manually in bootbox

I want to give vertical height manually in a bootbox prompt.
Here is the bootbox, We can fix it exactly in the center but I want to place it slightly above.
$('#btnNewPra').on('click',function(){
bootbox.prompt({
size: "small",
title: 'Spot',
margin: '50px' ,
// centerVertical: true,
callback: function(result){
}
})
})
Your simplest option is to use the className option and some custom CSS, like so: https://jsfiddle.net/6vmjpx3y/
bootbox.prompt({
size: "small",
title: 'Spot',
className: 'mini-box',
centerVertical: true,
callback: function(result) {
}
})
and
.mini-box .modal-dialog-centered .modal-content {
margin-top: -50px;
}
The className value would be whatever makes the most sense for you. There are probably other ways of accomplishing this, but using the centerVertical option adds the .modal-dialog-centered class to the dialog wrapper. You can then apply a negative margin to the .modal-content class (the outermost "visible" part of the modal) to pull the dialog up your desired amount from the center of the viewport.

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 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

Change Kendo grid row on click

I'm hoping someone can offer help in this. I have a Kendo grid in a html document (no MVC), and am wanting to change the class of the entire row on row select. I have tried various approaches, still with no luck. I am currently at:
// within kendo grid definition - grid called '#grid'
change: function (e) {
$("#grid tbody").find("tr[k-state-selected]").css("color", "black");
var id = $("#grid").closest("tr").css("color", "black");
CallDocument(this._data[0]);
},
The function CallDocument is being fired, and so I know I can at least get to the function.
EDIT: Here is the solution that I came up with, and thanks to everyone
change: function (e) {
$("#grid tbody").find("tr.k-state-selected").attr("class", "detail read k-state-selected");
},
I needed to use the 'tr.k-state-selected' form, and change using attr in order to change the set of classes.
To mark every visited row as selected, you might add a CSS class on change event.
var grid = $("#grid").kendoGrid({
dataSource: ds,
editable : false,
pageable : true,
selectable: true,
columns :
[
{ field: "FirstName", width: 90, title: "First Name" },
{ field: "LastName", width: 200, title: "Last Name" },
{ field: "City", width: 200 }
],
change : function (e) {
this.select().addClass("ob-selected");
}
}).data("kendoGrid");
The class ob-selected stays when you move to another cell since this does nothing to do with KendoUI.
Example here : http://jsfiddle.net/2TGLp/1/
The only question is that it does not stay selected if you apply filters, change to a different page... but not sure if this is important for you.
I override my Kendo styles using both css and javascript (depending on the scenario).
CSS:
.k-state-selected {
color: black;
}
Javascript/jQuery:
$('k-state-selected').css('color', '#000000')