Format List View in JSON - row borders? My own styles? - json

I have a list view in SharePoint Online that I'm formatting using JSON. I'm trying to set it so the rows have top borders (ideally, I'd like it to be conditional, but let's walk before we run).
I don't want to do anything else. There are a lot of columns, so I don't want to create a child for each field if I can avoid it. Besides, I don't think that will do what I want.
I've done lots of looking around (including the examples in GitHub, UI Fabric) and it appears that the only way to format a row in a view is to apply a class, and the only classes I can find that seem to be available are the built in ones like sp-field-severity--good. I couldn't find any that just had a top border.
So my questions are these:
- is there a comprehensive list of these classes somewhere?
- can I set a CSS style on a row or create my own CSS class to apply?

SharePoint provide some class for set border color.
Example.
{
"schema": "https://developer.microsoft.com/json-schemas/sp/view-formatting.schema.json",
"additionalRowClass": "ms-borderColor-themeDark"
}
We can open the IE F12 developer tools, switch the Debugger tab, search "ms-border", we can see only some class about the border color.
For custom the list view, we can also create custom style for the grid and using SPFx extension to injects custom CSS to achieve some requirement.
Solution: react-application-injectcss
Article: Inject Custom CSS on SharePoint Modern Pages using SPFx Extensions

Related

How can I hide an option from a select list using CSS?

I'm not a coder so please be gentle with your advice. I created a website in Wordpress and I purchased a plugin called Dokan which allowed me to create a marketplace. There is a specific select list with various options shown to my website's vendors in their vendor portals. I can also see this same select list with the same options from my WordPress panel which is not accessible by my site's vendors.
I would like to hide a specific option from select list so that vendors cannot see it anymore, only myself. I would like to hide it through css.
I want to hide 'wc-failed'
When you are logged in as the Wordpress administrator you should be able to see in the lefthand panel Appearance. Go to Customize then to Additional CSS.
You can type in extra CSS styling rules here.
To not show the particular option you can select it and set it through:
#order_status option[value="wc-failed"] { display: none; }
Note, this should result in that option not being seen, and no space reserved for it in the list (unlike visibility: hidden). However, the code is still there should the user have a look through their browser and they could reinstate it. I doubt this matters in this circumstance, but it's as well to be aware that if there is say a security issue if they go to that option they can still get there.

Autodesk Viewer: Show a list of elements with specified Database IDs

The functionality I seek is very similar to the default ModelStructurePanel model browser, except that I need to list only a subset of elements, by passing a list of dbIds of the elements I want listed. By clicking on an element on that list, have the view focus on that element.
I figure there might be two ways of achieving this by using the ModelStructurePanel (although I'm open to using something else):
Creating a new instanceTree with only the specified elements, then doing something like viewer.modelstructure.setModel(newInstanceTree)
Overwriting the ModelStructurePanel.shouldInclude method to hide all elements but the specified ones.
I have googled for Viewer code boilerplate that would provide this functionality, but have not found it. Any help is very much appreciated.
There is a basic sample here very close to what you described, and I would go with customizing just one action instead create a new one, seems easier.

Displaying image content types as grids in drupal 7?

I am currently using the Views and Display Suite modules to create a page that works as an image gallery. You click on the menu button to take you to a page (the view) that has multiple links to nodes (individual galleries).
When you click these nodes, they take you into the separate page and show all images uploaded using the "event" content type that I made.
The event content type has one field (type: image) that uses a multiupload widget, allowing for multiple file uploads.
However, the images on the node are displayed within divs, so they all have their own rows basically. I would like to know if it was possible to put them all into grids, and if so; how? I tried using display suite, but I only have that one field to work with.
If you want to get a fully customized page and arrange the fields just like you want, use the theme suggestions.
For a node of type "event", as you said, it would be node--event.tpl.php. You can duplicate the code inside the base template node.tpl.php of your parent theme (or if you don't have one, of Bartik for example) to have a good starting material.
Just rearrange the div, the tags, the variables as your convenience, add some custom CSS to make your grid, and you should be done!
I hope it helps.

html css menu visibility hide by permissions

I would like use an html/css menu and hide menu items based on users permissions/rights. What would be the best way to handle this? Can it be done just using CSS/HTML or using scripting like Javascript.
The permissions are through "allow roles" subfolders with web.config authorizations. So users cannot go to the wrong page but I want to hide the choices they can't actually access.
I am using VB.net code behind FYI.
You can't do this in static CSS/HTML, but you could print different CSS statements for each role if you dynamically generate it.
Or you could assign class 'admin' to certain items, set to display:none in CSS then use jQuery to show them:
if(userIsAdmin)
{
$('.admin').show();
}
However, I prefer to do this server-side if possible and only print certain items for certain users because, as Yoda said, anyone can see the source if you do it client side.

'[Inspectable]' metadata tag

Anyone can explain briefly about the [Inspectable] metadata tag. I read and could not understand in live docs.
Please help me when we are going to use the [Inspectable] metadata tag?
Thanks,
ravi
The tag is used with properties to provide code hints for that property and to specify the possible list of values that property can take while using it in mxml. Unlike [Bindable] metadata, this tag doesn't have much effect on the working of the code (other than specifying a default value) - this is used mainly to give directions to Flex Builder regarding how to deal with a particular property.
[Inspectable] metadata tag
Defines an attribute exposed to component users in the attribute hints and Tag inspector of Flex Builder. Also limits allowable values of the property.
For example, the verticalScrollPolicy property of the mx.core.Container class has the following [Inspectable] tag with it.
[Inspectable(category="General", enumeration="off,on,auto", defaultValue="auto")]
public function get verticalScrollPolicy():String
{
return _verticalScrollPolicy;
}
This tells Flex Builder that this property should appear in the 'General' tab (it is 'Common' in my FB) of the Flex Builder's property inspector (open an mxml file, go to the Windows menu and select Flex Properties to open the property inspector - towards the upper side of inspector tab, near its title, you will find buttons to switch to standard view, category view, and alphabetical view). This property can take one of the three values off, on, auto and if none is specified it takes auto as its default value.
I've never used this tag and I believe you too won't be using it much unless you are writing a Flex API to be used by a bigger audience than your colleagues (or if you are a perfectionist).
This tag is useful for when you write your own custom components. While it does not interact with the actual code you write (unlike the [Bindable] tag, mentioned above), it does give the Flexbuilder environment a way of allowing the user to set properties of your component using the UI Designer.
Therefore, the tag is useful if you want to:
Write components that are to be used by other people (make only the publicly accessible properties Inspect'able)
You've written a custom component that is used multiple times in your UI (maybe an extended slider). You then write some Inspect'able getter/setter methods as the public API to your component, and then implement these getter/setter methods to do data validation and implement the internal logic of your component.
You can find more information and examples here. Some good info on writing custom components (using the code behind methodology, which I prefer) can be found here.
Note: When creating exposed properties using [Inspectable], they don't seem to show up in the Flexbuilder Flex-Properties panel (not in Standard view anyway, use Category view or Alphabetical view, instead)
Note: You can find an alternative method of adding public properties to your custom components using MXLM, like this.