1

I need some help. I have a server side processed jquery.datatable. One of the columns is a numeric col with values between 0 and 180.

I would like to filter this column with yadcf ranger_number_slider. I set the yadcf like this:

{
       column_number: 14,
       filter_type: 'range_number_slider',
       filter_container_id: 'external_filter_container_ZZ'
}

But I am faced with some problems: On the first page of the datatable (paging size is 10, number of entries is roundabout 10.000), the values of this specific column are (accidentally) only from 0 to 30. The ranger_number_slider shown in the div "external_filter_container_ZZ" is as shown below:

Ranger-Number-Slider

As you see in the image, the slider is set from 0 on the left side to 30 on the right side. It seems, that the slider doesn´t get all values from the server side processing for this specific column.

Furthermore: If I try to select some values in the slider, the result in the table is always empty, and the slider disappears!

Is anybody able to give some hints for this behaviour?

Thank you very much in advance.

Best regards BeSt

BeSt
  • 43
  • 5

1 Answers1

0

Not only that its possible, its available on the showcase page - see here, you must do some reading in the docs / showcase (source on github too) and you will find all the needed docs for that, in short: in addition to your table data that is sent form server to client you must provide yadcf with its data as well - populate the yadcf_data_COL_NUM with the relevant data,

aaData:[["Trident", "Internet Explorer 4.0", "Win 95+", "7/24/2015", "1"],…]
draw:"2"
recordsFiltered:6
recordsTotal:57
yadcf_data_0:[{value: "Trident", label: "Trident Eng'"}, {value: "Tasman", label: "Tasman Eng'"},…]
yadcf_data_1:["Nintendo DS browser", "Netscape Browser 8", "All others", "Lynx", "Mozilla 1.6", "Mozilla 1.5",…]
yadcf_data_2:["N800", "Win 95+ / Mac OS 8.6-9.2", "S60", "KDE 3.5", "Win XP SP2+", "KDE 3.3", "OSX.3", "KDE 3.1",…]
yadcf_data_4:["134", "0"] <- this is for range slider filter tips

From showcase docs

//In case that you want to populate your select / auto_complete filters with values //you have to add to your current JSON the following attributes yadcf_data_0 / yadcf_data_1 / etc' //where each attribute contains a list of strings //For example: //"yadcf_data_0":["KHTML","Webkit","Trident","Misc","Other browsers","Tasman","Presto","Gecko"],

Daniel
  • 36,833
  • 10
  • 119
  • 200
  • Please be not angry with me, but I don´t understand it. I can´t find docs on how to get this to work. I only have PHP and JS. I don´t know where to place or integrate the sown java-code. The JSON-result is returned by the PHP-func "complex" in the "ssp.class.php" which comes with the SSP-module of jquery.datatables. Sorry for being a newbie, but I am really stuck. Can anybody provide some more hints? – BeSt Oct 04 '16 at 09:58
  • its all cool, try looking at this example provided by a user https://github.com/vedmack/yadcf/issues/206 , also search github for php/yadcf related code – Daniel Oct 04 '16 at 11:07
  • I get the increasing feeling, that I am too untalented (or too dumb) to understand these processes.... Concerning the example you linked at github: I can see the php-implementation of the ssp-files of datatables. But these code-fragments are the same as I use... they are the standard implementation. I cant find anything wich makes ranger_slider working or anything that shows me how to populate the yadcf_data_X-Information into the JSON-result..... – BeSt Oct 04 '16 at 11:52