- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2020 06:58 AM
Hi,
I am née for service portal. My requirement is to when onclick of a button popup a static HTML table with some content. If any one has done like this requirement earlier can provide me code or what needs to be config?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2020 05:28 AM
Try This,
HTML Script:
<div>
<style>
. >div {
height: 15em;
width: 19em;
padding: 0.5em 1em;
margin: 0 0em 1em 0;
background-color: #fff;
color: #00385a;
}
. div li {
list-style-image: url('potato-bullet.png');
}
. div>div {
height: 95%;
background-image: url('');
background-repeat: no-repeat;
background-position: top right;
}
</style>
<a class="" href="">
<ul ng-if="::c.options.bulletList">
<li ng-repeat="b in ::c.options.bulletList"></li>
</ul>
</a>
</div>
<div>
<button class="btn btn-primary" ng-click="c.openModal()">${Open Modal}</button>
</div>
<script type="text/ng-template" id="modalTemplate">
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">Modal Window</h4>
</div>
<div class="panel-body wrapper-xl">
<table class="table table-striped table-bordered">
<h2>Table data</h2>
<tr>
<th scope="col">Column 1</th>
<th scope="col">Column 2</th>
<th scope="col">Column 3</th>
</tr>
<tr>
<td scope="col">data 1</td>
<td scope="col">data 2</td>
<td scope="col">data 3</td>
</tr>
<tr>
<td scope="col">data 1</td>
<td scope="col">data 2</td>
<td scope="col">data 3</td>
</tr>
</table>
</div>
<div class="panel-footer text-right">
<button class="btn btn-primary" ng-click="c.closeModal()">${Close Modal}</button>
</div>
</div>
</script>
Client Script:
function($uibModal, $scope) {
/* widget controller */
var c = this;
c.options.cssClassName = "lw-tile-" + c.options.cssClassName;
c.openModal = function() {
c.modalInstance = $uibModal.open({
templateUrl: 'modalTemplate',
scope: $scope
});
}
c.closeModal = function() {
c.modalInstance.close();
}
}
Let me know if it work's

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2020 07:09 AM
Hi,
For testing i create something like that:
HTML CODE:
<div>
<!-- your widget template -->
<form class="large-margin-bottom col-xs-offset-3 col-xs-6">
<div class="form-group">
<label for="Name Text">${Full Name}:</label>
<input class="input-lg form-control" type="text" ng-model= "c.data.fullName" placeholder="Enter Employee Name" >
</div>
<button type="submit" ng-click="c.send_fullName(c.data.fullName);"class="btn btn-primary btn-lg btn-block">
<i ng-if="c.data.loading" class="fa fa-spinner fa-spin m-r-sm"></i>${Search}
</button>
</form>
<div ng-if= "!c.data.loading && c.data.json.length>0">
<table class="table table-striped table-bordered">
<caption>List of actions for this Employee</caption>
<thead class="thead-light">
<tr>
<th scope="col">Employee Name</th>
<th scope="col">Occupation</th>
<th scope="col">Location</th>
<th scope="col">Start Date</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="item in data.json">
<td>{{item}}</td>
<td>{{item}}</td>
<td>{{item}}</td>
<td>{{item}}</td>
</tr>
</tbody>
</table>
</div>
CLIENT CONTROLLER:
function() {
/* widget controller */
var c = this;
//Name send to server
c.send_fullName = function(test) {
c.data.loading = true;
c.data.action = "addName";
c.data.loading = false;
c.server.update().then(function() {
c.data.action = undefined;
c.data.fullName = '';
})
}
}
SERVER SIDE:
(function() {
/* populate the 'data' object */
/* e.g., data.table = $sp.getValue('table'); */
data.fullName = '';
data.showTable = '';
data.json = [];
if (input && input.action == 'addName') {
data.fullName = input.fullName;
var subject_person = 'Ashutosh';
//fetchHR(data.fullName);
data.json = ['a','b','c','d','e','g'];
//getEmployeeData(data.fullName);
}
})();
OUTPUT:
Please change it as per your requirement.
Thanks,
Ashutosh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2020 07:59 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2020 08:03 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2020 08:05 AM