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

Error undefinded ColumnObj with ServerSide, Range_Number and Custom_Range_Delimiter #564

Closed
dbaselica opened this issue Apr 5, 2019 · 3 comments

Comments

@dbaselica
Copy link

Detecten on: 0.9.4.beta.25

In a DataTable with serverSide: true
In yadcf with externally_triggered: true
yadcf a column with
filter_type: "range_number", or "rangne_date"
custom_range_delimiter: 'MYDELIMITER'

throw an error ColumnObj undefined
in:
function exFilterColumn(table_arg, col_filter_arr, ajaxSource) {
.....
.....
case 'range_number':
.....
.....
if (table_arg.fnSettings().oFeatures.bServerSide === true) {
table_arg.fnSettings().aoPreSearchCols[column_position].sSearch = filter_value.from + columnObj.custom_range_delimiter + filter_value.to;
}

columnObj.custom_range_delimiter is not defined

Thanks

@vedmack
Copy link
Owner

vedmack commented Apr 7, 2019

@dbaselica please post a test link so I could debug it

@dbaselica
Copy link
Author

dbaselica commented Apr 8, 2019

Sorry my english....

I can't post code, because i haven't server-side in a public space to show you
I can show to you a non functional example, because


var dtable;
var table;

//The server side must return this
//var data = [
//{ "name": "One", "value": "1"},
//{ "name": "Two", "value": "2"},
//{ "name": "One, Two, Three", "value": "1,2,3"}
//];

var columns =
[
{ data: "name", width: '100px',defaultContent: "" },
{ data: "value", width: '100px',defaultContent: "" }
];

var MyGridAjax = {
type: 'GET',
url: 'WebService1.asmx/GetData',
contentType: 'application/json; charset=utf-8',
dataType: 'json',
dataFilter: function (resp) {
var mCad;
mCad = resp.replace('{"d":null}', "");
return mCad;
},
error: function (jqXhr, textStatus, errorThrown) {
alertify.alert('Error', jqXhr.responseText);
}
};

table = $('#tb');
dtable = table.DataTable({
//data: data,
columns: columns,
searching: true,
serverSide: true,
ajax: MyGridAjax
});

adcf.init(dtable,
[
{ column_number: 0, filter_type: "text", filter_delay: 500 },
{
column_number: 1,
filter_type: "range_number",
custom_range_delimiter: 'MYDELIMITER' ,
filter_delay: 500
}
],
{ externally_triggered: true, }
);

Test Test

<input type="button" onclick="yadcf.exResetAllFilters(dtable);" value="Limpiar Filtros" "/>

When debug.. I found an error in

function exFilterColumn(table_arg, col_filter_arr, ajaxSource) {
.....
.....
case 'range_number':
.....
.....
if (table_arg.fnSettings().oFeatures.bServerSide === true) {
table_arg.fnSettings().aoPreSearchCols[column_position].sSearch = filter_value.from + columnObj.custom_range_delimiter + filter_value.to;
}

because columnObj is null

@vedmack vedmack closed this as completed in a0e59d0 Apr 8, 2019
@vedmack
Copy link
Owner

vedmack commented Apr 8, 2019

looks like a copy / paste mistake 😄 , please try 0.9.4.beta.26
@misanek

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

No branches or pull requests

2 participants