Issue in responsiveness of datatable while using javascript modules.
Issue in responsiveness of datatable while using javascript modules.
Is there any restriction to use the datatable in jquery modules? because i can use the datatable with responsive mode while i initiating the datatable from the document.ready itself.
but, If we added the initiation in any javascript class and created object for that then, It will be used for intiation. but, the responsiveness of the datatable is lost.
How can we use the data table initiation in javascript class methods without losing the responsiveness of the grid?
Datatable is working with following code.
$(document).ready(function () {
var dTable = $('#CustomerDataGrid').DataTable({
responsive: true});
});
but, it is not working(losting responsiveness) in the below code.
var GridManager = (function (business) {
business.DataGrid = {};
var DataGridGenerator = function () {
this.BuildDataGrid = function () {
var dTable = $('#CustomerDataGrid').DataTable({
responsive: true});
};
business.DataGrid.GridGenerator = DataGridGenerator;
return business;
}
$(document).ready(function () {
var grid = new business.DataGrid.GridGenerator();
grid .BuildDataGrid ();
}):
Thanks in advance for the clarification.
Answers
Guys , finally i found the reason for not working of responsiveness while using javascript module pattern to build a datatable.
In middle of somewhere, i did jquery $().show() and $().hide() operations . It causes the issues of removing responsiveness of the datatables.
Now the issue is fixed in my scenario.