filmov
tv
jQuery datatable show hide columns
Показать описание
Link for all dot net and sql server video tutorial playlists
Link for slides, code samples and text version of the video
Healthy diet is very important both for the body and mind. If you like Aarvi Kitchen recipes, please support by sharing, subscribing and liking our YouTube channel. Hope you can help.
In this video we will discuss how to show or hide columns of a jQuery datatable. This is continuation to Part 107. Please watch Part 107 from jQuery tutorial before proceeding.
When we click on a column name, the respective column visibility should be toggled. The following are the changes required for the example we worked with in Part 107.
Include the following HTML just above the datatable markup
<div style="padding: 5px; padding-left: 0px">
<b>Show/Hide Column : </b>
<a class="showHideColumn" data-columnindex="0">Id</a> -
<a class="showHideColumn" data-columnindex="1">First Name</a> -
<a class="showHideColumn" data-columnindex="2">Last Name</a> -
<a class="showHideColumn" data-columnindex="3">Gender</a> -
<a class="showHideColumn" data-columnindex="4">Job Title</a> -
<a class="showHideColumn" data-columnindex="5">Web Site</a> -
<a class="showHideColumn" data-columnindex="6">Salary</a> -
<a class="showHideColumn" data-columnindex="7">Hire Date</a>
</div>
Include the following style section, in the head section of the page
<style>
.showHideColumn {
cursor: pointer;
color: blue;
}
</style>
Finally, include the following code block in the success callback function
$('.showHideColumn').on('click', function () {
});
Link for slides, code samples and text version of the video
Healthy diet is very important both for the body and mind. If you like Aarvi Kitchen recipes, please support by sharing, subscribing and liking our YouTube channel. Hope you can help.
In this video we will discuss how to show or hide columns of a jQuery datatable. This is continuation to Part 107. Please watch Part 107 from jQuery tutorial before proceeding.
When we click on a column name, the respective column visibility should be toggled. The following are the changes required for the example we worked with in Part 107.
Include the following HTML just above the datatable markup
<div style="padding: 5px; padding-left: 0px">
<b>Show/Hide Column : </b>
<a class="showHideColumn" data-columnindex="0">Id</a> -
<a class="showHideColumn" data-columnindex="1">First Name</a> -
<a class="showHideColumn" data-columnindex="2">Last Name</a> -
<a class="showHideColumn" data-columnindex="3">Gender</a> -
<a class="showHideColumn" data-columnindex="4">Job Title</a> -
<a class="showHideColumn" data-columnindex="5">Web Site</a> -
<a class="showHideColumn" data-columnindex="6">Salary</a> -
<a class="showHideColumn" data-columnindex="7">Hire Date</a>
</div>
Include the following style section, in the head section of the page
<style>
.showHideColumn {
cursor: pointer;
color: blue;
}
</style>
Finally, include the following code block in the success callback function
$('.showHideColumn').on('click', function () {
});
Комментарии