Spacing between columns 'ResponsiveGridLayout' (SAPUI5) - styles

How can I reduce the spacing in a ResponsiveGridLayout? In this image I want that there is no sapcing betweem the SearchField an the Button. I've searched via Google and take a close look in the API, but I found nothing.
EDIT:
var oResponsiveLayout = new sap.ui.layout.form.ResponsiveGridLayout({
columnsL : 3,
columnsM : 3,
columnS : 1
});
var oFormLayout = new sap.ui.layout.form.Form({
layout : oResponsiveLayout,
formContainers : [ new sap.ui.layout.form.FormContainer({
formElements : [ new sap.ui.layout.form.FormElement({
fields : [ this.oSearchField = new sap.ui.commons.SearchField({
width : "100%",
placeholder : "Suchtext / ID",
search : this._onSearchRequest.bind(this),
layoutData : new sap.ui.layout.GridData({
span : "XL9 L9 M6 S6"
})
}) ]
}) ]
}), new sap.ui.layout.form.FormContainer({
formElements : [ new sap.ui.layout.form.FormElement({
fields : [ this.oArrowUp = new sap.ui.commons.Button({
layoutData : new sap.ui.layout.GridData({
span : "XL1 L1 M2 S2"
}),
width : "100%",
icon : "resources/images/arrow_up.png",
tooltip : new sap.ui.commons.RichTooltip({
text : "Vorheriges Element der Suche anzeigen"
}),
press : this._onSearchArrowUpRequest.bind(this)
}), this.oArrowDown = new sap.ui.commons.Button({
layoutData : new sap.ui.layout.GridData({
span : "XL1 L1 M2 S2"
}),
width : "100%",
icon : "resources/images/arrow_down.png",
tooltip : new sap.ui.commons.RichTooltip({
text : "Nächstes Element der Suche anzeigen"
}),
press : this._onSearchArrowDownRequest.bind(this)
}) ]
}) ]
}),

Here is the solution; you can add empty Label before SearchField and set the labelSpan(M/L/S) according to your need.
It will also be responsive, so you are safe to use it.

class="sapUiSmallMarginEnd"
Use above class in SearchField in the xml view

Related

How to add custom notes to the toolbox in react echarts

I want to add a custom notes on the tool box in react echarts.
Using below code i am able to add the text box.
When i click on text box i want to write some text and save it to the load chart. Is there any way to acheive this functionality. Please let me know. Thanks .
enter code here brush : {
toolbox : ['rect'],`enter code here`
brushLink : [0 , 1, 2 , 3],
brushType : 'rect',
brushMode : ['single'],
outOfBrush: {
color: '#abc'
},
brushStyle: {
borderWidth: 2,
color: 'rgba(0,0,0,0.2)',
borderColor: 'rgba(0,0,0,0.5)',
},
throttleDelay: 300,
},
toolbox : {
show : false,
feature : {
brush : {
type : ['rect'],
title : {
rect : 'Active Brush'
}
}
}
}

How to get the plotly theme as a dictionary?

I would like to have the definition of the plotly theme (or any other theme that comes with plotly for that reason) as a dictionary, i.e., in this format:
ggplot' : {
'colorscale':'ggplot',
'linewidth':1.3,
'linecolor':'pearl',
'bargap' : .01,
'layout' : {
'legend' : {'bgcolor':'white','font':{'color':'grey10'}},
'paper_bgcolor' : 'white',
'plot_bgcolor' : 'grey14',
'yaxis' : {
'tickfont' : {'color':'grey10'},
'gridcolor' : 'lightivory',
'titlefont' : {'color':'grey10'},
'zerolinecolor' : 'lightivory',
'showgrid' : True
},
'xaxis' : {
'tickfont' : {'color':'grey10'},
'gridcolor' : 'lightivory',
'titlefont' : {'color':'grey10'},
'zerolinecolor' : 'lightivory',
'showgrid' : True
},
'titlefont' : {'color':'charcoal'}
},
'annotations' : {
'fontcolor' : 'grey10',
'arrowcolor' : 'grey10'
}
In other words, I would like to know the specs of the theme.
How I can get this information?

How to enter data in textarea using mechanize or request in python

I am trying to automate using python for generating PFAM domain image for protein sequence using https://pfam.xfam.org/generate_graphic. I tried to submit text in the textarea that is provided in the webpage. The following is the following code that i have tried. Any help or suggestions is appreciated. Thanks in advance.
import requests
url = 'https://pfam.xfam.org/generate_graphic'
params = {
'text': '''{
"length" : "534",
"regions" : [
{
"type" : "pfama",
"text" : "Peptidase_S8",
"colour" : "#2dcfff",
"display": "true",
"startStyle" : "curved",
"endStyle" : "curved",
"start" : "159",
"end" : "361",
"aliEnd" : "350",
"aliStart" : "163"
},
{
"type" : "pfama",
"text" : "PA",
"colour" : "#ff5353",
"display" : true,
"startStyle" : "jagged",
"endStyle" : "curved",
"start" : "388",
"end" : "469",
"aliEnd" : "469",
"aliStart" : "396"
}
]
}''' # this is the contents of the text area
}
# start a web-scraping session (mostly, for maintaining cookies)
session = requests.Session()
session.get(url)
print (session.get(url))
# submit the "form"
response = session.post(url, data=params)
data = response.json()
Best,
sameer

How to delete a column in dojox/grid/EnhancedGrid

Do we have any way to delete a column in dojox/grid/EnhancedGrid. Please let us know if there is any solution for this.
Please find my sample grid.
Details: it creates a dojox/grid/EnhancedGrid and has an action associated with clicking a header row. What action can I add to delete the column?
var dataStore = new ObjectStore({objectStore: objectStoreMemory});
// grid
grid = new EnhancedGrid({
selectable: true,
store: dataStore,
structure : [ {
name : "Country",
field : "Country",
width : "150px",
reorderable: false,
editable : true
}, {
name : "Abbreviation",
field : "Abbreviation",
width : "120px",
reorderable: false,
editable : true
}, {
name : "Capital",
field : "Capital",
width : "100%",
reorderable: false,
editable : true
} ],
rowSelector: '20px',
plugins: {
pagination: {
pageSizes: ["10", "25", "50", "100"],
description: true,
sizeSwitch: true,
pageStepper: true,
gotoButton: true,
maxPageStep: 5,
position: "bottom"
}
},
dodblclick: function() {
alert("Header clicked");
}
}, "grid");
grid.startup();
you need to use the method
grid.setStructure(newLayout);
or
grid.set('structure',newLayout);
here newLayout is the layout that you need to create without the columns that you need.
Hope this helps.

All fields search [duplicate]

This question already has answers here:
MongoDB Query Help - query on values of any key in a sub-object
(3 answers)
Closed 6 years ago.
This is my data set, which is part of a bigger json code. I want to write a query, which will match all fields inside the value chain.
Dataset:
"value_chain" : {
"category" : "Source, Make & Deliver",
"hpe_level0" : "gift Chain Planning",
"hpe_level1" : "nodemand to Plan",
"hpe_level2" : "nodemand Planning",
"hpe_level3" : "nodemand Sensing"
},
Example:
If someone searches for "gift", the query should scan through all fields, and if there is a match, return the document.
This is something I tried, but didnt work
db.sw_api.find({
value_chain: { $elemMatch: { "Source, Make & Deliver" } }
})
Sounds like you need to create $text index on all the text fields first since it performs a text search on the content of the fields indexed with a text index:
db.sw_api.createIndex({
"value_chain.category" : "text",
"value_chain.hpe_level0" : "text",
"value_chain.hpe_level1" : "text",
"value_chain.hpe_level2" : "text",
"value_chain.hpe_level3" : "text"
}, { "name": "value_chain_text_idx"});
The index you create is a composite index consisting of 5 columns, and mongo will automatically create the text namespace for you by default if you don't override it. With the above, if you don't specify the index name as
db.sw_api.createIndex({
"value_chain.category" : "text",
"value_chain.hpe_level0" : "text",
"value_chain.hpe_level1" : "text",
"value_chain.hpe_level2" : "text",
"value_chain.hpe_level3" : "text"
});
there is a potential error "ns name is too long (127 byte max)" since the text index will look like this:
"you_db_name.sw_api.$value_chain.category_text_value_chain.hpe_level0_text_value_chain.hpe_level1_text_value_chain.hpe_level2_text_value_chain.hpe_level3_text"
Hence the need to give it a name which is not too long if autogenerated by mongo.
Once the index is created, a db.sw_api.getIndexes() query will show you the indexes present:
/* 1 */
[
{
"v" : 1,
"key" : {
"_id" : 1
},
"name" : "_id_",
"ns" : "dbname.sw_api"
},
{
"v" : 1,
"key" : {
"_fts" : "text",
"_ftsx" : 1
},
"name" : "value_chain_text_idx",
"ns" : "dbname.sw_api",
"weights" : {
"value_chain.category" : 1,
"value_chain.hpe_level0" : 1,
"value_chain.hpe_level1" : 1,
"value_chain.hpe_level2" : 1,
"value_chain.hpe_level3" : 1
},
"default_language" : "english",
"language_override" : "language",
"textIndexVersion" : 3
}
]
Once you create the index, you can then do a $text search:
db.sw_api.find({ "$text": { "$search": "gift" } })

Resources