label should come on right side of text box in datatable plugin

bibli2oo3

New Member
I am using data tables jquery plugin...In that search box comes up...Right now my label is on left side and search box on right side...How to move the search text box on left side and label on right side...I have put my code in fiddle...If I put js plug in code separately in JS panel it does not work....so i have combined the code and put it in one panel....http://jsfiddle.net/bz2C4/37/my related code starts from line 2121\[code\]#moveLabel { border: 1px solid black;}.dataTables_filter label { border: 1px solid red; background: lemonchiffon;}.dataTables_filter { position: static; text-align: center;}\[/code\]providing my code below\[code\]/** * Generate the node required for filtering text * @returns {node} Filter control element * @param {object} oSettings dataTables settings object * @memberof DataTable#oApi */ function _fnFeatureHtmlFilter ( oSettings ) { var oPreviousSearch = oSettings.oPreviousSearch; var sSearchStr = oSettings.oLanguage.sSearch; sSearchStr = (sSearchStr.indexOf('_INPUT_') !== -1) ? sSearchStr.replace('_INPUT_', '<input type="text" />') : sSearchStr==="" ? '<input type="text" />' : sSearchStr+' <input type="text" />'; var nFilter = document.createElement( 'div' ); nFilter.className = oSettings.oClasses.sFilter; nFilter.innerHTML = '<label id="moveLabel">'+sSearchStr+'</label>'; if ( !oSettings.aanFeatures.f ) { nFilter.id = oSettings.sTableId+'_filter'; } var jqFilter = $('input[type="text"]', nFilter); // Store a reference to the input element, so other input elements could be // added to the filter wrapper if needed (submit button for example) nFilter._DT_Input = jqFilter[0]; jqFilter.val( oPreviousSearch.sSearch.replace('"','"') ); jqFilter.bind( 'keyup.DT', function(e) { /* Update all other filter input elements for the new display */ var n = oSettings.aanFeatures.f; var val = this.valuehttp://stackoverflow.com/questions/15817881/==="" ? "" : this.value; // mental IE8 fix :-( for ( var i=0, iLen=n.length ; i<iLen ; i++ ) { if ( n != $(this).parents('div.dataTables_filter')[0] ) { $(n._DT_Input).val( val ); } } /* Now do the filter */ if ( val != oPreviousSearch.sSearch ) { _fnFilterComplete( oSettings, { "sSearch": val, "bRegex": oPreviousSearch.bRegex, "bSmart": oPreviousSearch.bSmart , "bCaseInsensitive": oPreviousSearch.bCaseInsensitive } ); } } ); jqFilter .attr('aria-controls', oSettings.sTableId) .bind( 'keypress.DT', function(e) { /* Prevent form submission */ if ( e.keyCode == 13 ) { return false; } } ); return nFilter; }\[/code\]
 
Back
Top