chzn-select class is not working Proper on DataTable
chzn-select class is not working Proper on DataTable
sudhanshu
Posts: 2Questions: 0Answers: 0
Below is my HTML I am Applied class but nor working Proper this gave us. drop down not working opening below and Closing
-----------HTML-------
06:00 AM06:15 AM06:30 AM06:45 AM07:00 AM07:15 AM07:30 AM07:45 AM08:00 AM08:15 AM08:30 AM08:45 AM09:00 AM09:15 AM09:30 AM09:45 AM10:00 AM10:15 AM10:30 AM10:45 AM11:00 AM11:15 AM11:30 AM11:45 AM12:00 PM12:15 PM12:30 PM12:45 PM01:00 PM01:15 PM01:30 PM01:45 PM02:00 PM02:15 PM02:30 PM02:45 PM03:00 PM03:15 PM03:30 PM03:45 PM04:00 PM04:15 PM04:30 PM04:45 PM05:00 PM05:15 PM05:30 PM05:45 PM06:00 PM06:15 PM06:30 PM06:45 PM07:00 PM07:15 PM07:30 PM07:45 PM08:00 PM08:15 PM08:30 PM08:45 PM09:00 PM09:15 PM09:30 PM09:45 PM10:00 PM10:15 PM10:30 PM10:45 PM11:00 PM11:15 PM11:30 PM11:45 PM12:00 AM12:15 AM12:30 AM12:45 AM01:00 AM01:15 AM01:30 AM01:45 AM02:00 AM02:15 AM02:30 AM02:45 AM03:00 AM03:15 AM03:30 AM03:45 AM04:00 AM04:15 AM04:30 AM04:45 AM05:00 AM05:15 AM05:30 AM05:45 AM
_________HTML END ----------
function getDataTableCols(cols) {
var tableCols = [];
$(cols).each(function(index, tObj) {
var sType = tObj.sType;
tableCols.push({
"sTitle": tObj.sTitle,
"sType": sType,
"sWidth": tObj.width,
"sClass": tObj.sClass,
"sSortDataType":tObj.aSortDataType,
"mRender": function(data, type, val) {
if (tObj.sType === 'currency') {
data = formatcurrencynew(data, type, val, tObj);
}else if (tObj.sType === 'numeric-comma') {
data = formatcurrencynew(data, type, val, tObj);
}
return data;
}
});
});
return tableCols;
}
$(document).ready(function() {
var tblCols= {"columns":[{"sTitle":"Select","mData":"col0","sType":"","aSortDataType":"dom-checkbox"},{"sTitle":"Type","mData":"col0","sType":"","width":"70%"},{"sTitle":"Start Time","mData":"col1","sType":"","width":"70%"},{"sTitle":"End Time","mData":"col2","sType":"","width":"70%"},{"sTitle":"Wed","mData":"col3","width":"70%","sClass":"text-center"},{"sTitle":"Thu","mData":"col4","width":"70%","sClass":"text-center"},{"sTitle":"Fri","mData":"col5","width":"70%","sClass":"text-center"},{"sTitle":"Sat","mData":"col6","width":"70%","sClass":"text-center"},{"sTitle":"Sun","mData":"col7","width":"70%","sClass":"text-center"},{"sTitle":"Mon","mData":"col8","width":"70%","sClass":"text-center"},{"sTitle":"Tue","mData":"col9","width":"70%","sClass":"text-center"}],"rows":[]};
var aoColumns=getDataTableCols(tblCols.columns);
var oTable = $('#EMP_AVAL_WEEKLY_COMP_tbl').dataTable({
"bProcessing": false,
"bPaginate": true,
"aoColumns": aoColumns,
"bJQueryUI": false,
"sDefaultContent": "",
"sDom": "Rlfrtip",
"sScrollX": "100%",
"bScrollCollapse": true,
"sScrollY": "350px",
"oLanguage": {
"sZeroRecords": "No data Found.",
"sInfoEmpty": "Showing 0 - 0 of 0 records",
"sInfo": "Showing _START_ - _END_ of _TOTAL_ records",
"sLengthMenu": "_MENU_ Records per page"
},
"fnDrawCallback": function() {
var divObj = $('#EMP_AVAL_WEEKLY_COMP_tbl').parents();
divObj
.find('.dataTables_scrollBody')
.niceScroll({
cursorborderradius:4,
background:"#E8E8E8",
autohidemode:false,
cursorcolor: '#A0A0A0',
cursorwidth: "8px",
cursorborder:"1px solid #D3D3D3"
});
divObj.find('.dataTables_scrollBody').getNiceScroll().show().onResize();
// $("select").addClass("chzn-drop-up");
$('.dataTables_scrollBody select').addClass("chzn-drop-up");
$(".chzn-drop-up").trigger("liszt:updated");
$(".chzn-drop-up").chosen();
var config = {
'.chzn-select' : {},
'.chzn-select-deselect' : {
allow_single_deselect : true
},
'.chzn-select-no-results' : {
no_results_text : 'Oops, nothing found!'
},
'.chzn-select-width' : {
width : "95%"
}
}
for ( var selector in config) {
$(selector).chosen(config[selector]);
}
}
});
/*$('form').submit(function(){
$(oTable.fnGetHiddenTrNodes()).appendTo(this);
});*/
});
-----------HTML-------
06:00 AM06:15 AM06:30 AM06:45 AM07:00 AM07:15 AM07:30 AM07:45 AM08:00 AM08:15 AM08:30 AM08:45 AM09:00 AM09:15 AM09:30 AM09:45 AM10:00 AM10:15 AM10:30 AM10:45 AM11:00 AM11:15 AM11:30 AM11:45 AM12:00 PM12:15 PM12:30 PM12:45 PM01:00 PM01:15 PM01:30 PM01:45 PM02:00 PM02:15 PM02:30 PM02:45 PM03:00 PM03:15 PM03:30 PM03:45 PM04:00 PM04:15 PM04:30 PM04:45 PM05:00 PM05:15 PM05:30 PM05:45 PM06:00 PM06:15 PM06:30 PM06:45 PM07:00 PM07:15 PM07:30 PM07:45 PM08:00 PM08:15 PM08:30 PM08:45 PM09:00 PM09:15 PM09:30 PM09:45 PM10:00 PM10:15 PM10:30 PM10:45 PM11:00 PM11:15 PM11:30 PM11:45 PM12:00 AM12:15 AM12:30 AM12:45 AM01:00 AM01:15 AM01:30 AM01:45 AM02:00 AM02:15 AM02:30 AM02:45 AM03:00 AM03:15 AM03:30 AM03:45 AM04:00 AM04:15 AM04:30 AM04:45 AM05:00 AM05:15 AM05:30 AM05:45 AM
_________HTML END ----------
function getDataTableCols(cols) {
var tableCols = [];
$(cols).each(function(index, tObj) {
var sType = tObj.sType;
tableCols.push({
"sTitle": tObj.sTitle,
"sType": sType,
"sWidth": tObj.width,
"sClass": tObj.sClass,
"sSortDataType":tObj.aSortDataType,
"mRender": function(data, type, val) {
if (tObj.sType === 'currency') {
data = formatcurrencynew(data, type, val, tObj);
}else if (tObj.sType === 'numeric-comma') {
data = formatcurrencynew(data, type, val, tObj);
}
return data;
}
});
});
return tableCols;
}
$(document).ready(function() {
var tblCols= {"columns":[{"sTitle":"Select","mData":"col0","sType":"","aSortDataType":"dom-checkbox"},{"sTitle":"Type","mData":"col0","sType":"","width":"70%"},{"sTitle":"Start Time","mData":"col1","sType":"","width":"70%"},{"sTitle":"End Time","mData":"col2","sType":"","width":"70%"},{"sTitle":"Wed","mData":"col3","width":"70%","sClass":"text-center"},{"sTitle":"Thu","mData":"col4","width":"70%","sClass":"text-center"},{"sTitle":"Fri","mData":"col5","width":"70%","sClass":"text-center"},{"sTitle":"Sat","mData":"col6","width":"70%","sClass":"text-center"},{"sTitle":"Sun","mData":"col7","width":"70%","sClass":"text-center"},{"sTitle":"Mon","mData":"col8","width":"70%","sClass":"text-center"},{"sTitle":"Tue","mData":"col9","width":"70%","sClass":"text-center"}],"rows":[]};
var aoColumns=getDataTableCols(tblCols.columns);
var oTable = $('#EMP_AVAL_WEEKLY_COMP_tbl').dataTable({
"bProcessing": false,
"bPaginate": true,
"aoColumns": aoColumns,
"bJQueryUI": false,
"sDefaultContent": "",
"sDom": "Rlfrtip",
"sScrollX": "100%",
"bScrollCollapse": true,
"sScrollY": "350px",
"oLanguage": {
"sZeroRecords": "No data Found.",
"sInfoEmpty": "Showing 0 - 0 of 0 records",
"sInfo": "Showing _START_ - _END_ of _TOTAL_ records",
"sLengthMenu": "_MENU_ Records per page"
},
"fnDrawCallback": function() {
var divObj = $('#EMP_AVAL_WEEKLY_COMP_tbl').parents();
divObj
.find('.dataTables_scrollBody')
.niceScroll({
cursorborderradius:4,
background:"#E8E8E8",
autohidemode:false,
cursorcolor: '#A0A0A0',
cursorwidth: "8px",
cursorborder:"1px solid #D3D3D3"
});
divObj.find('.dataTables_scrollBody').getNiceScroll().show().onResize();
// $("select").addClass("chzn-drop-up");
$('.dataTables_scrollBody select').addClass("chzn-drop-up");
$(".chzn-drop-up").trigger("liszt:updated");
$(".chzn-drop-up").chosen();
var config = {
'.chzn-select' : {},
'.chzn-select-deselect' : {
allow_single_deselect : true
},
'.chzn-select-no-results' : {
no_results_text : 'Oops, nothing found!'
},
'.chzn-select-width' : {
width : "95%"
}
}
for ( var selector in config) {
$(selector).chosen(config[selector]);
}
}
});
/*$('form').submit(function(){
$(oTable.fnGetHiddenTrNodes()).appendTo(this);
});*/
});
This discussion has been closed.
Replies