How can I replicate the wizard modal menu? I like the style of the wizard modal but don't require the behaviour of a wizard ie. steps validation etc.
I'm currently using the clr-tree-node for my menu with the grid which gets me close to the wizard style but it would be great to match it exactly.
This is what I have at the moment:
<clr-modal [(clrModalOpen)]="display" [clrModalSize]="'lg'" [clrModalClosable]="true">
<h3 class="modal-title">Preferences</h3>
<div class="modal-body">
<div class="row">
<div class="col-md-4">
<clr-tree-node *ngFor="let menuItem of menu" >
<a class="clr-treenode-link" [class.active]="menuItem.id === activeMenuItem" (click)="toggleContent(menuItem)">{{menuItem.name}}</a>
<ng-template [clrIfExpanded]="expandedCheck(menuItem.id)" *ngIf="menuItem | objectHas:'subMenu'">
<clr-tree-node *ngFor="let subMenuItem of menuItem.subMenu">
<a class="clr-treenode-link" [class.active]="subMenuItem.id === activeMenuItem" (click)="toggleContent(subMenuItem)">{{subMenuItem.name}}</a>
</clr-tree-node>
</ng-template>
</clr-tree-node>
</div>
<div class="col-md-8">
<form [formGroup]="form">
<h4>General</h4>
Related
I'm working with asp.net core mvc and I have two views, one to edit a profile and another to show the profile. The view to edit the profile has checkboxes and the view to show the profile has a list with the items that got selected in the edit view. Whenever I edit the profile, all the checkboxes are unselected. I want that whenever I'm on the EditProfile view, the items that were on the ShowProfile view get selected and the others unselected. If I select a checkbox, that item gets added to the list and if I unselect a previous selected item, that item gets removed from the list. Since I'm a beginner, I have no idea how to do this working with both views. I did multiple things and it didn't work
Part of the ShowProfile view
#model ModifyProfile
#{
}
<div class="card">
<div class="card-body">
<a class="btn btn primary"href="\ProfileDetails\EditProfile">Edit</a>
</div>
</div>
<div class="card-body">
<h3 class="mb-3">Interests</h3>
<div class="mb-3">
<div class="text">Interests:</div>
#if (Model.InterestProfile != null){
<ul>
#foreach(InterestProfile interestProfile in Model.InterestProfiles{
<li class="mb-3">
#interestProfile.Interest.InterestName
</li>
}
</ul>
}else
{
#:No interests
}
</div>
</div>
Part of the EditProfileView
#model ProfileViewModel
#{
}
<form action="EditProfile" method="post">
<div class="card">
<div class="card-body">
<button class="btn btn-primary" type="submit">Submit changes</button>
</div>
</div>
<div class="card">
<div class="card-body">
<div>
<label class="form-label">Interested in</label>
<div class="checkbox">
#foreach (Interest interest in Model.Interests)
{
<label><input type="checkbox" name="interestId" value="#interest.InterestId">
#interest.InterestName </label>
}
</div>
</div>
</div>
</div>
Is there a way to do it with checkboxes? I think that a dropdown list could be helpful here but I don't know if it's worth deleting all the code I have already to make that change
I am using ngx-bootstrap accordion with angular 9. The header always contains the 'card' and 'card-header' classes and I don't want them .. how can I remove these classes when the html is constructed
this is my code:
<accordion>
<accordion-group>
<div accordion-heading>
'HEADER TEXT'
</div>
<div>
'BODY TEXT'
</div>
</accordion-group>
</accordion>
And what I get is
<accordion-group _ngcontent-yeu-c53="" class="panel panel-open" style="display: block;" _nghost-yeu-c13="" ng-reflect-is-open="true"><div _ngcontent-yeu-c13="" class="panel card panel-default" ng-reflect-ng-class="panel-default"><div _ngcontent-yeu-c13="" role="tab" class="panel-heading card-header panel-enabled" ng-reflect-ng-class="panel-enabled">
I'm trying to render the rows of a table where each row is my custom component <todo-list>, but the resulting rows get rendered outside of my table. Why is this?
Here's a screenshot of the DOM tree which shows what is happening:
My view:
<div class="container">
<div class="row">
<div class="col-md-8 col-md-offset-2">
<div class="panel panel-default">
<div class="panel-heading">Dashboard</div>
<div class="panel-body">
<div id="appTest">
<div>#{{error}}</div>
<table class="table-responsive">
<todo-list
v-for="todo in todos"
v-bind:todo-obj="todo"
v-bind:key="todo.id"
:todo-obj.sync="todo"
v-on:usun="deleteTod"
></todo-list>
</table>
<div v-if="isLogged" id="todoText">
<textarea v-model="todoText" cols="53" rows="5"></textarea>
<div id="addButton">
<button v-on:click="addTodo" class="btn btn-success" >Add to do</button>
</div>
</div>
<div v-else>
You have to be
Login
to add new todos
</div>
</div>
</div>
</div>
</div>
</div>
</div>
And here is my component:
Vue.component('todoList', {
props: ['todoObj'],
template: '<tr>' +
'<td><div class="round"><input id="todoObj.id" type="checkbox" v-on:click="toggle" v-model="todoObj.done" /><label for="todoObj.id"></label></div></td>' +
'<td class="textTodo">{{todoObj.description}}</td>' +
'<td><button v-on:click="deleteTodo" class="btn-xs btn-danger">delete</button></td>' +
'</tr>',
Also my checkboxes are not working. They look fine, but they don't toggle when I click them, they only react when checking the first row from the table. Why?
Your table might not be rendering correctly due to DOM Template Parsing Caveats. Try this instead:
<table class="table-responsive">
<tr
v-for="todo in todos"
is="todo-list"
:todo-obj="todo"
:key="todo.id"
#usun="deleteTod"
></tr>
</table>
Also you had the todoObj bound twice (I removed the .sync one in the above code).
As for the checkbox issue, I'm not completely sure on what the problem is, especially since you have not provided the code for the component (a fiddle would be great). Why do you have #toggle and v-model? Couldn't you just use v-model? You also forgot to v-bind to the checkbox's id attribute: id="todoObj.id" (is that necessary anyway?).
<button class="ui button" #click="beforeAdd">添加</button>
<div class="ui modal">
<div class="header">Header</div>
<div class="content">
<div class="description">
<p>Description</p>
</div>
</div>
<div class="actions">
<div class="ui negative right labeled icon button">
取消
<i class="remove icon"></i>
</div>
<div class="ui positive right labeled icon button">
提交
<i class="checkmark icon"></i>
</div>
</div>
</div>
view methods:
beforeAdd(){
const modal = $(this.$el).find('.ui.modal')
console.log(modal)
modal.modal('show')
}
first click,modal show, second click nothing happened, I found semantic change modal to root for div class='ui dimmer modals page transition hidden',how can solve it
Semantic is removing it from your $(this.$el) so next time it does not find it.
It works when you use with global $ and an id:
show(){
const showModal = $('#mymodal')
console.log(showModal)
showModal.modal('show')
}
See Updated fiddle.
If you also want to use Vue variables in your modal, it is necessary to clone the modal and only show the cloned version.
With this approach Vue will still be able to keep track of the original modal, because Semantic doesn't remove it from the DOM.
beforeAdd(){
const modal = $(this.$el).find('.ui.modal').clone()
console.log(modal)
modal.modal('show')
}
I know similar questions have been asked earlier, but I have tried them and they aren't working. I have a dialog box, with some text and a button, which I need to position in the center of the box. My HTML is given below:
<div id='step3' class='item'>
<div class='row span9'>
<div class="text center"><button id='loginButton' class='btn btn-success' onClick='window.location.reload()'>Login again</button></div>
<small>using your new credentials.</small>
</div>
</div>
I tried placing the button inside a div and used <div style="text-align:center"> but it didn't work. Does anyone know how I could place the button in the center, preferably without adding an external CSS class?
Your class="text center" should be class="text-center", and you also don't need the row tag (it breaks the responsiveness).
<div id="step3" class="item">
<div class="span12">
<div class="text-center">
<button id="loginButton" class="btn btn-success" onClick="window.location.reload()">Login again</button>
<br> <small>using your new credentials.</small>
</div>
</div>
Also you have single quotes '' on most of your markup. Keep in mind this is with an old version of Bootstrap so depending on how wide the viewport is it might not be perfectly center.