boundary

boundary

niksa.blonderniksa.blonder Posts: 3Questions: 1Answers: 0

Link to test case:
Debugger code (debug.datatables.net):
Error messages shown:
Description of problem:

Answers

  • niksa.blonderniksa.blonder Posts: 3Questions: 1Answers: 0

    I'm having problem capturing search options that include cases other than regex. Here is an example of the code that I'm using:

    table.column(1).search('Allan', {
    boundary: true
    });

    Out of the 5 boolean options listed in the documentation (boundary, caseInsensitive, exact, regex, smart) the only one that gets captured and passed down in the request is the regex option as in:

    table.column(1).search('Allan', {
    regex: true
    });

    I'm using the latest version of datatables with server side processing. Is there something that I'm missing here or is this a bug?

  • allanallan Posts: 63,482Questions: 1Answers: 10,467 Site admin

    Unless you are using your own server-side processing script, the ones we provide don't support either regex or the boundary option for server-side processing I'm afraid. They are client-side specific options.

    Allan

  • niksa.blonderniksa.blonder Posts: 3Questions: 1Answers: 0
    edited November 19

    Hi Allan,

    I understand that if I'm using my own server-side processing that I need to implement my own way to search on boundary or regex, but what I am asking is how can I communicate to my server side script which search option I want to create. Here is perhaps a better explanation of what I mean.

    Let's say name is on column index 1. So then if the JavaScript call looks something like this:

    table.column(1).search('Allan', {regex: true});

    The GET or POST call sent to my server side script includes something like this:

    columns[1][data]=1
    columns[1][name]=
    columns[1][searchable]=true
    columns[1][orderable]=true
    columns[1][search][value]="Allan"
    columns[1][search][regex]=true

    and this works because DataTables do recognize the regex:true value being passed in. However when making this call:

    table.column(1).search('Allan', {boundary: true});

    I expected to see this in my GET or POST sent to server side script

    columns[1][data]=1
    columns[1][name]=
    columns[1][searchable]=true
    columns[1][orderable]=true
    columns[1][search][value]="Allan"
    columns[1][search][boundary]=true

    Unfortunately that's not what is happening. So how can I communicate to my server side script if I want to search on any one of the other options besides regex?

  • allanallan Posts: 63,482Questions: 1Answers: 10,467 Site admin

    Got you - thanks for the clarification. So at the moment, those options are not transmitted to the server, since I don't currently have any plans to implement them server-side, and the SSP request object is already quite large (at least for cases when there are a lot of columns).

    This is the point in the DataTables code where the column search parameters are added to the server-side Ajax object.

    You'd need to add:

    boundary: preColSearch[i].boundary ? true : false,
    

    The ternary is needed, as it appears boundary can be undefined, which I unexpected and I'll look into that.

    Allan

Sign In or Register to comment.