how to add bootstrap grid in side of my main RTE in umbraco? - umbraco

I have a Document Type which has a main content box (RTE). now I wand add a grid layout inside it and add "Partial View Macro" to this grid cells.
for example create a 1*3 grid and add a summery card inside of each cell. like this view :
in this case I implement card as a "Partial View Macro"

You should be able to create a macro that can point to a separate node that contains a Grid Layout property and similar to a template calling the GetGridHtml() extension method, you can call it from your macro code like this:
Html.GetGridHtml(gridNode, "gridLayourPropertyName");
Where gridNode is an IPublishedContent object that your macro can have as a parameter, and "gridLayourPropertyName" is the Grid Layout property of that node.
I haven't used this technique using a Macro from a RTE, but I've done something similar to build a grid within another grid layout. This may not be the best technique to follow and I'd strongly recommend looking into replacing the RTE property with a grid layout. You can use RTE as a grid editor, so you could migrate your existing property data and then you will have all the flexibility to create/configure/customize grid editors using current best practices to meet your requirements.

Related

Recommended way to do the search and populating the grid in ASP.NET Core MVC 6

I am creating a project where I need to create a view with search textboxes and a dropdown which would be populated from the server. Same view also have a grid which would be populated based on the search criteria enter/selected by user.
I want to know what would be the design of the page in terms of showing both on same page. Should I create a partial view for the grid or Search panel or add both in the single view?
Note that dropdown list would need to be populated from the ViewModel. So what is the common practice in the situation. I am new to this I have done few pages but with lot of code, session and ViewBags and I think I am not following recommended practice.
Actually, the design for your web application is according to your requirement.
For example, if you want grid to work with other datasource or view, you could build it as a component, then if you want to use it, you could directly use this component to avoid write the same codes for multiple time.
If you want to use same grid to show in some other page, you could build it a partial view, then you could directly call this view to show something.

Ui-grid: how can I create multiple ui grids dynamically

I need to display multiple ui grids in my screen. The number of grids are dynamic.
Scenario: I am adding some people in a list and proceeds to next screen where I need to display their details in a separate ui grid. How can I create grid options dynamically?
Wrap up the code and html inside a directive, pass the table data to the directive.See the answer from user CMR here...I hope this helps.
Custom directive for Ui Grid

Deciding between NgComponent and NgDirective

Is there some rule of thumb to be followed while deciding to implement custom element as NgComponent or NgDirective?
What are the issues to keep in mind while deciding to choose either of them?
If you want to add functionality/behavior to existing tags/elements you use a directive (like ng-class or ng-hide).
You can apply a directive to different tags.
To create a new element/tag you create a component (like accordion, carousel, modal, ...).
A component is a new custom element that can have a template that defines its shadow DOM content.
You can use a directive to dynamically add/remove html content too, but with a component you can create new elements that have a clear boundary between inside and outside.
A component has it's own scope that is not part of the application scope hierarchy.
You can't easily reach inside a components content.
Html generated from a directive is like any other html tags. You have transclusion with components (I think someone is working on components without shadow DOM and transclusion like in Angular.js but I don't know how far this is and how this will look like.)
You can use directives inside a component, and a component inside a component.

Actionscript: Position elements one after another automatically

Is it possible to make Sprites position themselves one after another automatically.
Similar to display:display-block in CSS.
For example i'm adding Sprites to some parent in a row, the way they are in xml skin file and they are automatically position themselves next to each other.
Is there an event, which tells that a child were added to the parent?
I could implement some extended Sprite, to position pushed elements automatically, by calculating where the last element is located?
Why the hell Actionscipt doesn't have something like CSS in it? It's a pain in the ass to build UI inside it, compared to HTML...
Madness...
In case of "raw" ActionScript you should either search for an appropriate library or do it your self. ActionScript doesn't define any CSS like logic.
On the other hand Flex does, but you will not find any CSS that let you define layout. CSS is used to modify visual appearance of containers and components in Flex. Layout is usually done with the layout property of the container classes provided by Flex. For example yo can use a Group and set its layout property to an instance of HorizontalLayout or VerticalLayout. This will automatically position all child components of the group either in x or in y direction. In case of using Flex you cannot use sprites directly, but there are many components you can use. Maybe there is one for your purposes.
See the Flex API documentation. The spark.components package will be a good starting point.

grid binding to a listbox selecteditem runtime

I am a beginner, so please bear with me.
Let's say we have a listbox and a grid that contains textblocks on a window. But these are instanced from separate xaml files, and added to two different stackpanels in the window.
How can I bind the grid datasource to the listbox's selected item in runtime?
I guess what I need to do is to do this following xaml in runtime:
Grid DataContext="{Binding ElementName=lstContacts, Path=SelectedItem}"
Thanks.
You could handle the Window's Loaded event, and in your handler: traverse your Window's children using VisualTreeHelper to find your ListBox based on its name, then set your Grid's DataContext.
Here is a question that discusses, and provides a method for, finding children in such a manner.

Resources