Wrong way to sort ?
Wrong way to sort ?
Lapointe
Posts: 430Questions: 81Answers: 4
Tks
For searchbuilder 1.0.1, I found something starnge at line 2190 :
if (that.s.type === 'array' || that.s.type === 'string' || that.s.type === 'num' || that.s.type === 'html' || that.s.type === 'html-num') {
if ($(a).val() < $(b).val()) {
return -1;
}
else if ($(a).val() < $(b).val()) {
return 1;
}
else {
return 0;
}
}
I mean result is strange, because comparision is the same 2 times, not ?
Bob
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Hi @Lapointe ,
Yes that is correct, thank you for letting us know. I've changed it now.
This will be available in the next SearchBuilder release which we hope will be in the next few weeks. Until then you can access the fix from the nightly builds.
Thanks,
Sandy
hi @sandy @allan
https://nightly.datatables.net/searchbuilder/js/dataTables.searchBuilder.js line 1629 error if filter has null parts... when trying to replace special char in
Else the select option list show compound elements with no separator, like comma or spaces or...
If stateSave is active (with not special set for stateSaveParams or stateLoadParams) when restoring saved parameter (as searchbuilder) result is not correct as said in this discussion : https://datatables.net/forums/discussion/67799/searchbuilder-staterestore-do-not-work-when-array-type#latest
and DateTime definition at line 66 is still here... (https://datatables.net/forums/discussion/67789/editor-use-internal-datetime-definition#latest)
Hi @Lapointe ,
I'm not sure what you mean by this. Could you create a test case so I can see the error please?
Thanks,
Sandy
I think this is because you test if filter is null. If not then you do replace for each el in
the array... Some el of the filter may be null, and this is the bug I touch yesterday...
I add a test before replace and work fine
lines 1625 - 1631
Hi @Lapointe ,
Good spot, thanks for that. I've made the fix now. This will be available in the next SearchBuilder release which we hope will be in the next few weeks. Until then you can access the fix from the nightly builds.
Thanks,
Sandy