Search, order between two letter number string

Search, order between two letter number string

goktuginal41@gmail.comgoktuginal41@gmail.com Posts: 57Questions: 22Answers: 0

Hello everyone,

I can display the age part in the intervals(range) I want, but the salary part starts with HV and continues with the number.(HV05, HV45 etc...) I can't display this part in the range I want. Do you have any idea how to do that?

Before selection:
HV045, HV035, HV015, HV005, HV025, HV055

After select the range between 5 and 35:
HV05, HV015, HV025, HV035

Thank you in advance.

http://live.datatables.net/bimolome/2/edit

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,531Questions: 1Answers: 10,475 Site admin

    Apologies - I'm not quite understanding the question. Do you want the data to sort in a natural order? If so, use this plug-in.

    Allan

  • goktuginal41@gmail.comgoktuginal41@gmail.com Posts: 57Questions: 22Answers: 0
    edited September 2022

    Hey Allan,

    There are two fields to choose min and max of salary(HV05 etc...) and I want to display what is between min and max values. But it does not work because its not integer and it starts with HV.

    For example, If I type 5 for min salary and 35 for max salary, I want to see all rows in the table between those numbers -> HV05, HV015, HV030

    Can you see my link above? I tried to show it with code example.

  • kthorngrenkthorngren Posts: 21,343Questions: 26Answers: 4,954
    Answer ✓

    You can use Orthogonal data to remove the HV from the value for the search operation. See the computed values example.

    I think you will need to change the structure of your search plugin. The problem is if you check the Age range it will always hit a return statement and not execute the code to check the salary range. The easiest way to fix the problem is to create two search plugins so they run independently.

    Kevin

  • goktuginal41@gmail.comgoktuginal41@gmail.com Posts: 57Questions: 22Answers: 0

    Thank you very much.

    I removed HV with the code below and it works fine.

    var salary = parseFloat(data[5].replace(/\D/g,'')) || 0;

Sign In or Register to comment.