Jump to content

pr0c3ss

New Members
  • Posts

    8
  • Joined

  • Last visited

pr0c3ss's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Was testing the outcome difference. No worry's about this now...works have annoyingly said another dpt has integrated a solution for what they want... thanks for advice oh requinix
  2. if ( ( min <= page && page >= max ) ) { return true; } full function... $.fn.dataTable.ext.search.push( function( settings, data, dataIndex ) { var inR = document.getElementById("in-range"); var outR = document.getElementById("out-range"); var min = parseInt( $('#min').val(), 10 ); var max = parseInt( $('#max').val(), 10 ); var page = parseFloat( data[11] ) || 0; if ($("#in-range").is(':checked')){ console.log('inrange active'); if ( ( isNaN( min ) && isNaN( max ) ) || ( isNaN( min ) && page <= max ) || ( min <= page && isNaN( max ) ) || ( min <= page && page <= max ) ) { return true; } } else{ console.log('outrange active'); if ( ( min <= page && page >= max ) ) { return true; } } //return false; } ); var table = $('#output').DataTable(); $('#min, #max').keyup( function() { table.draw(); }); });
  3. above values seem to return but below dont
  4. var page = a column in a html table perhaps if I link you this example https://datatables.net/examples/plug-ins/range_filtering.html This searches within a range - like above. I need the search to search outside of the range. So if min and max entered values are 3-7...and page column holds 1-10.... 1,2,3,7,8,9 should return
  5. The code example returns values that fall within the if statement (within entered min and max values)...which works fine... I have been trying to amend this, so it return values that fall outside of a given min and max range. So if table holds data 1-9 and some enters min 3 and max 7 as a range - the return should be 1,2,3,7,8,9
  6. If the logic of finding values between a min max range = var min = parseInt( $('#min').val(), 10 ); var max = parseInt( $('#max').val(), 10 ); var page = parseFloat( data[11] ) || 0; if ($("#in-range").is(':checked')){ if ( ( isNaN( min ) && isNaN( max ) ) || ( isNaN( min ) && page <= max ) || ( min <= page && isNaN( max ) ) || ( min <= page && page <= max ) ) { return true; } ... what's the logic of displaying values that fall outside of given min/max ranges? for ex. Table holds data 1-9. Min range = 3 max range = 7 the return should be 1,2,3,7,8,9
  7. You can simply change the position of elements within a width checking function...soemthing like $(document).ready(function() { function checkWidth() { var windowSize = $(window).width(); if (windowSize < 580){ ...position changes here } else if (windowSize > 580 && <720){ ...position changes here } } // Execute on load checkWidth(); // Bind event listener $(window).resize(checkWidth); });
  8. Been working with JQueryLocalizationTool (translation method) http://darksmo.github.io/jquery-localization-tool/ The plugin explicitly says it's meant to translate single pages. But if we fill the call to the plugin with the appropriate strings, we can translate other pages no problem. The problem is that the call to the plugin that holds the strings will become way too large. We want to separate the translation for each page and append the strings to the call of the plugin (if possible). At the moment we are calling the plugin like below... $(document).ready(function(){ $('#selectLanguageDropdown').localizationTool({ 'defaultLanguage' : 'en_GB', /* (optional) although must be defined if you don't want en_GB */ 'showFlag': true, /* (optional) show/hide the flag */ 'showCountry': false, /* (optional) show/hide the country name */ 'showLanguage': true, /* (optional) show/hide the country language */ 'languages' : { /* (optional) define **ADDITIONAL** custom languages */ 'ar_SA' : { 'country': 'Middle East', 'language': 'عربي', 'countryTranslated': 'عربي', 'languageTranslated' : 'عربي', 'flag': { 'class' : 'flag flag-sa' } } }, /* * Translate your strings below */ 'strings' : { /* * You can specify the text string to translate directly... */ 'About Us' : { ar_SA : 'تعرف علينا' }, We could have an exhaustive list of strings, but this is going to be very unorganised and slow the site down. We are using the MVC framework and hope to be able to place a language.js string file in each html content js folder where it can then be called/appended to the initial plugin call/language dropdown selection. Options and methods of the plugin can be viewed below https://github.com/darksmo/jquery-localization-tool Is the idea of calling/appending separate js string files depending on page in view possible? If not, any suggestions on how we can separate the strings? Thanks for looking
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.