cjai32 / jquery-datatables-column-filter

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

Added config options for datepicker and a max length for selection-box option labels #138

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I don't see a spot for contributions to the project, so I'm doing it here.

What steps will reproduce the problem?
1. Use "date-range" or "select" filters.
2. Be stuck with the default configurations of the two.

What is the expected output? What do you see instead?
I want to configure the datepicker behavior in a way other than the default.  I 
also want to limit the length of the <option>Display Text</option> in a 
selection field.

What version of the product are you using? On what operating system?
1.5.1, Windows

Please provide any additional information below.
I added two optional properties to the aoColumns object.
1.) A oDatepickerOptions property on a "date-range" filter will be passed 
through to the from.datepicker() and to.datepicker() functions.
2.) A iMaxOptionDisplayLength property on a "select" filter will be used to 
limit the length of the label used for an option.

Example use:

oTable.columnFilter({
    aoColumns: [
        { type: "date-range", oDatepickerOptions: { changeMonth: true, changeYear: true, showOtherMonths: true, selectOtherMonths: true }},
            { type: "select", iMaxOptionDisplayLength: 15, values: ["12345678901234567890", "1234567890"] },
        ]
});

In the drop-down selection list, the two options will be displayed as:
"123456789012..."
"1234567890"

Original issue reported on code.google.com by tim.marg...@gmail.com on 23 Oct 2013 at 7:08

Attachments:

GoogleCodeExporter commented 8 years ago
Looks like this (nice) solution is not part of the latest version (1.5.6)? 
Besides, it would be nice to use the custom date format for the cell data as 
well. I use the same custom format in my table and in that case the range 
filter fails. I fixed this by changing the line:
dCellDate = $.datepicker.parseDate($.datepicker.regional[""].dateFormat, 
aData[_fnColumnIndex(index)]);

to:

dCellDate = $.datepicker.parseDate(from.datepicker('option', 'dateFormat'), 
aData[_fnColumnIndex(index)]);

Original comment by Reinier....@funatic.nl on 15 Jul 2014 at 8:12