Comments (5)
Hello @KrupaVasava
Here is the demo link please check.
https://jsfiddle.net/nwmmbLso/3/
from deskapp.
Hello @dropways
Thank you for your reply.
We have check your given link,
but given data are static and we have dynamic data from DTL django python that we have to set through javascript. for e.g.
|
---|
from deskapp.
You can try this Column Rendering methods for this
<table class="table table-lg align-middle table-hover w-100 mt-0" id="column-rendering-table">
<thead>
<tr>
<th scope="col" class="no-sort">Id</th>
<th scope="col">Course Name</th>
<th scope="col">Category</th>
<th scope="col">Instuctor</th>
<th scope="col">Description</th>
<th scope="col">Progress</th>
<th scope="col">Status</th>
<th scope="col" class="no-sort">Action</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>Angular.Js</td>
<td>Frontend Development</td>
<td>Brad Traversy</td>
<td>Lorem ipsum dolor, sit amet consectetur adipisicing elit. Nesciunt sapiente sequi, dignissimos quia magnam
modi deleniti.</td>
<td>30</td>
<td>1</td>
<td nowrap="nowrap"></td>
</tr>
<tr>
<td>2</td>
<td>Codeigniter</td>
<td>Backend Development</td>
<td>Inside Codemedia</td>
<td>Lorem ipsum dolor, sit amet consectetur adipisicing elit. Nesciunt sapiente sequi, dignissimos quia magnam
modi deleniti.</td>
<td>100</td>
<td>3</td>
<td nowrap="nowrap"></td>
</tr>
</tbody>
</table>
$(document).ready(function() {
$("#column-rendering-table").DataTable({
responsive: true,
lengthMenu: [10, 15, 25, 50],
language: {
paginate: {
first: '<span class="bi bi-chevron-double-left"></span>',
previous: '<span class="bi bi-chevron-left"></span>',
next: '<span class="bi bi-chevron-right"></span>',
last: '<span class="bi bi-chevron-double-right"></span>',
},
},
order: [[1, "asc"]],
headerCallback: function (thead) {
thead.getElementsByTagName("th")[0].innerHTML = `
<div class="table-checkbox">
<input type="checkbox" value="" class="form-check-input group-checkable"/>
</div>`;
},
columnDefs: [
{
targets: "no-sort",
orderable: false,
},
{
targets: 0,
width: "30px",
className: "dt-left",
orderable: false,
render: function (data, type, full, meta) {
return `
<div class="table-checkbox table-checkbox-row">
<input type="checkbox" value="" class="form-check-input"/>
</div>`;
},
},
{
targets: -1,
width: "125px",
title: "Actions",
orderable: false,
render: function (data, type, full, meta) {
return `<div class="table-actions">
<button class="btn btn-icon btn-sm btn-success btn-transparent"><i class="bi bi-eye"></i></button>
<button class="btn btn-icon btn-sm btn-primary btn-transparent"><i class="bi bi-pen"></i></button>
<button class="btn btn-icon btn-sm btn-danger btn-transparent"><i class="bi bi-trash3"></i></button>
</div>`;
},
},
{
targets: 1,
render: function (data, type, full, meta) {
return (
'<div class="fw-medium text-truncate text-dark">' +
[data] +
"</div>"
);
},
},
{
targets: 4,
render: function (data, type, full, meta) {
return (
'<div class="text-truncate mx-w-200">' +
[data] +
"</div>"
);
},
},
{
targets: 5,
render: function (data, type, full, meta) {
return (
'<div class="d-flex align-items-center">' +
'<div class="progress w-80" style="height: 6px;">' +
'<div class="progress-bar" role="progressbar" style="width: ' +
[data] +
'%;" aria-valuenow="50" aria-valuemin="0" aria-valuemax="100"></div>' +
"</div>" +
'<div class="text-dark flex-shrink-0 ms-2 fw-medium">' +
[data] +
"%" +
"</div>" +
"</div>"
);
},
},
{
targets: 6,
width: "80px",
render: function (data, type, full, meta) {
var status = {
1: { title: "Ongoing", state: "info" },
2: { title: "Paused", state: "secondary" },
3: { title: "Done", state: "success" },
};
if (typeof status[data] === "undefined") {
return data;
}
return (
'<span class="fw-bold badge d-block rounded-pill bg-' +
[status[data].state] +
' px-3 py-2">' +
status[data].title +
"</span>"
);
},
},
],
});
$("#column-rendering-table").on("change", ".group-checkable", function () {
var set = $(this)
.closest("table")
.find(".table-checkbox-row .form-check-input");
var checked = $(this).is(":checked");
$(set).each(function () {
if (checked) {
$(this).prop("checked", true);
} else {
$(this).prop("checked", false);
}
});
});
});
from deskapp.
Thank you So much it's working.
really appreciate your help
from deskapp.
Hi
I need your help in all check box selection.
Please check below screenshot
As this screenshot we have 10 entries on 1st page and we are going to select on all checkbox. and that all are selected
If I choose to select all option from drop down then other checkbox is not showing as selected.
So, How can I get it that selected checkbox if we are going select all option from drop down.
from deskapp.
Related Issues (20)
- gulp-clean-css required twice in gulpfile.js HOT 1
- Highcharts issue HOT 2
- Herokuapp Demo Not working HOT 2
- [Question] Why does the scrollbar extend up into the top nav? HOT 1
- Icons not responding HOT 1
- This is not an issue but a wish HOT 3
- Please, make some css class to unmargin and unpadding lists (ol, ul), don't do it globally
- Notes concept
- No needs to use role="navigation" on <nav aria-label="breadcrumb">
- Unable to import core.css in angular style due to missing mCSB_buttons.png; HOT 2
- ReactJS integration
- Country code flag icon is not showing on form in for loop HOT 1
- autocomplete not working HOT 1
- project run slow
- How to display number of events counts in calendar view?
- Dark Mode and Bootstrap v5 plsssss HOT 4
- validate form step wizard
- How can I install it? HOT 1
- make the left menu fixed
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from deskapp.