Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Range Filter with Datatable Reorder #267

Closed
etlouie opened this issue Dec 10, 2015 · 10 comments
Closed

Range Filter with Datatable Reorder #267

etlouie opened this issue Dec 10, 2015 · 10 comments

Comments

@etlouie
Copy link

etlouie commented Dec 10, 2015

Hi,

I've read "Adding support for ColReorder to remaining filter_types #138" but for me it doesn't work with any range filters. I am using version 0.8.9.beta.26. The Select and Text filters work without any issues only the ranges ones don't. It basically continues to put the filter information in the original mDataProp, and bSearch parameters instead of the reorder parameters.

Also, using DataTable 1.10.10, jQuery v2.1.3, jQuery UI v1.11.4 and Bootstrap Bootstrap v3.3.4.

Let me know, if you need anything else.

Edward

@etlouie
Copy link
Author

etlouie commented Dec 10, 2015

Incase you didn't know, all filtering is server side.

@etlouie
Copy link
Author

etlouie commented Dec 10, 2015

Hi,
I did some debugging of your code and discovered that you are not using the ColReorder. Don't know if the following is even correct, but it did allow the RangeNumberSlide to use the reorder parameters

function rangeNumberSliderChange(table_selector_jq_friendly, event, ui) {
event = eventTargetFixUp(event);
var oTable,
min_val,
max_val,
slider_inuse,
yadcfState,
column_number = $(event.target).attr('id').replace("yadcf-filter-", "").replace(table_selector_jq_friendly, "").replace("-slider-", ""),
columnObj,
keyUp;

    oTable = oTables[table_selector_jq_friendly];

// These three line below allow the to use the ColReorder #, instead of the original column_number
var settingsDt = getSettingsObjFromTable(oTable);
initColReorder2(settingsDt, table_selector_jq_friendly)
column_number = plugins[table_selector_jq_friendly].ColReorder[column_number];
columnObj = getOptions(oTable.selector)[column_number];

    keyUp = function () {

                    $.fn.dataTableExt.iApiIndex = oTablesIndex[table_selector_jq_friendly];

@etlouie
Copy link
Author

etlouie commented Dec 11, 2015

Correction, the code should be
var settingsDt = getSettingsObjFromTable(oTable);
initColReorder2(settingsDt, table_selector_jq_friendly)
if (plugins[table_selector_jq_friendly] !== undefined && (plugins[table_selector_jq_friendly] !== undefined && plugins[table_selector_jq_friendly].ColReorder !== undefined)) {
column_number = plugins[table_selector_jq_friendly].ColReorder[column_number];
}
So that is ColReorder is not used, the range slider will still work

@vedmack
Copy link
Owner

vedmack commented Dec 15, 2015

Please provide a link to a jsbin/jsfiddle with the issue, otherwise I wont be able to reproduce/debug it

@etlouie
Copy link
Author

etlouie commented Dec 17, 2015

I'll try and get this one in the next few days

@etlouie
Copy link
Author

etlouie commented Jan 4, 2016

I started to strip out everything from my JSP file, but I've looked at jsbin/jsfiddle and don't know how to provide the information you need, since it requires server side access and a database connection. If I hardcode the data into the HTML, there is no issues. Any suggestions?

@vedmack
Copy link
Owner

vedmack commented Jan 4, 2016

create a jsbin with range filters with reorder ability and that it, something simple (2 rows are enough)
the simplier the better...

@etlouie
Copy link
Author

etlouie commented Jan 4, 2016

If I create a simple HTML file with a few rows with reorder ability and a range filter, there is no issue. The issue only happens when we do a server side call because the parameter information is not stored in the correct mDataProp, and bSearch variables.

If you look at the "hack" fix above to function rangeNumberSliderChange(), I hope you can see that the original "Column Orders" are used instead of the "Reordered Columns".

Thanks,
Edward

@vedmack
Copy link
Owner

vedmack commented Jan 9, 2016

will try to take a look at it this week...

@vedmack
Copy link
Owner

vedmack commented Jan 23, 2016

Without a link to a working test case I wont be able to help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants