jayzakung / jquery-datatables-column-filter

Automatically exported from code.google.com/p/jquery-datatables-column-filter
0 stars 0 forks source link

Date range Internationalisation #87

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
N/A 

What is the expected output? What do you see instead?
expected output : <input...> <span id="someid>"oT</span> <input...> <span 
id="someid"> morF</span>

see instead : From <input...> To <input...>

What version of the product are you using? On what operating system?
1.4.8., last Firefox, windows 7

Please provide any additional information below.
Hi! should be great if we could use the date range with Internationalisation!!! 
2 features asked :
  1 - option to define the show order of date range (right to left => for arabic countries...)
  2 - Some span around the "From" and "To" we could select with jQuery to change content into what we want.

To do that, i tried to parse the content of span element, including the 2 field 
with this code :

$('#myform span .filter_date_range').each(function(i){ 
        var input = {};
        var e=0;

        $(this).children(':input').each(function(o){
            input[e] = $(this)[0].outerHTML; e++; 
        });

        $(this).html(input[1]+' oT '+input[0]+' morF');
    });

Showing what i want... BUT date picker doesn't run anymore on the field...

Could you please add some options in date range initialisation to allow thoses 
features?
Thanks!

Original issue reported on code.google.com by remi.val...@gmail.com on 23 Aug 2012 at 7:10

GoogleCodeExporter commented 8 years ago
Well i see that's the job of sRangeFormat param. But i cant' change the 
position of {from} and {to}. When i do that, {from} & {to} are displayed on the 
page...

THIS IS OK :
.columnFilter({
       aoColumns:[...],
       sRangeFormat: "From {from} to {to}"
});

THIS IS NOT-OK :
.columnFilter({
       aoColumns:[...],
       sRangeFormat: "From {to} to {from}"
});

MY AIM IS :
.columnFilter({
       aoColumns:[...],
       sRangeFormat: "{to} ot {from} morF"
});
(morF & ot => Arabic ;)).

So issue should be rename into "Bug with sRangeFormat param init"...

Original comment by remi.val...@gmail.com on 23 Aug 2012 at 10:08

GoogleCodeExporter commented 8 years ago
This issue was closed by revision r70.

Original comment by joc...@gmail.com on 4 Sep 2012 at 9:28

GoogleCodeExporter commented 8 years ago
Hi,

This is one of the most weirdest feature request I had :) Could you take the 
latest version and try it? I think that it works on 
http://jquery-datatables-column-filter.googlecode.com/svn/trunk/dateRange%20-%20
Issue%2087.html

Thanks,
Jovan

Original comment by joc...@gmail.com on 4 Sep 2012 at 9:29

GoogleCodeExporter commented 8 years ago
Yes it works!
Thanks a lot!
Lyrad

Original comment by remi.val...@gmail.com on 11 Sep 2012 at 8:06

GoogleCodeExporter commented 8 years ago
I like the edit for internationalisation, but I have a comment and a request :

1 : 

you didn't apply the code for the non date range input, it still apears like it 
use to, I took the liberty to change it on my code (pretty much a copy paste of 
the date range):
       function fnCreateRangeInput(oTable) {

            var aoFragments = sRangeFormat.split(/[}{]/);

            th.html("");

            //var currentFilter = oTable.fnSettings().aoPreSearchCols[i].sSearch;
           // th.html(_fnRangeLabelPart(0));
            var sFromId = oTable.attr("id") + '_range_from_' + i;
            var from = $('<input type="text" class="number_range_filter form-control" id="' + sFromId + '" rel="' + i + '"/>');
            //th.append(from);
            //th.append(_fnRangeLabelPart(1));
            var sToId = oTable.attr("id") + '_range_to_' + i;
            var to = $('<input type="text" class="number_range_filter form-control" id="' + sToId + '" rel="' + i + '"/>');
            //th.append(to);
           // th.append(_fnRangeLabelPart(2));

            for (ti = 0; ti < aoFragments.length; ti++) {

                if (aoFragments[ti] == properties.sDateFromToken) {
                    th.append(from);
                } else {
                    if (aoFragments[ti] == properties.sDateToToken) {
                        th.append(to);
                    } else {
                        th.append(aoFragments[ti]);
                    }
                }
            }

2 : would it be possible to set default values so that they don't need to be 
changed every time you call on datatables?

Cheers,

Original comment by mathieu....@gmail.com on 7 Jul 2014 at 2:44