SearchPanes with Server Side Processing in Java

SearchPanes with Server Side Processing in Java

demetrioldemetriol Posts: 8Questions: 3Answers: 0

Hi,
I would like to use search panes, but I have several rows so I decided to migrate to server side processing. All works well (pagination, ordering, filters on single columns, global filters), but I can't integrate SearchPanes.

The parameters sent to the server don't include the "searchPanes" entry. Maybe I made a wrong configuration?

Here is my config:

 var table = $('#showassetwithoutproblems').DataTable( {
            searchPanes : {
                layout: 'columns-2',
                columns : [ 1, 3  ],
                dataLength: 60,
                //viewTotal: true 
            },  
            
            
            language: {
                searchPanes: {
                    count: '{total} found',
                    countFiltered: '{shown} ({total})'
                }
            },
            
          deferRender: true, //Feature control deferred rendering for additional speed of initialisation    
             bServerSide: true,
              sAjaxSource: "/CMDB/jsp/problems/serversideprocessing/getassetwithoutproblems_ss.jsp",
              bProcessing: true,
              sPaginationType: "full_numbers",
              bJQueryUI: true,  
              ...

on server I received only the following params:


sEcho | 1
iColumns | 27
sColumns | ,,,,,,,,,,,,,,,,,,,,,,,,,,
iDisplayStart | 0
iDisplayLength | 10
mDataProp_0 | nome_asset
sSearch_0 |
bRegex_0 | false
bSearchable_0 | true
bSortable_0 | true
sSearch |
bRegex | false
iSortCol_0 | 0
sSortDir_0 | asc
iSortCol_1 | 1
sSortDir_1 | desc
iSortingCols | 2
_ | 1606841395373


Any help will be appreciated. Thank you

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    It would be worth looking at this blog post - it discusses how to integrate the server-side script from Editor to get SearchPanes working correctly. Let us know if you're having problems after giving it a try,

    Colin

  • demetrioldemetriol Posts: 8Questions: 3Answers: 0
    edited December 2020

    Thank you for your support, but I don't need the Editor features. Just the SearchPanes filters with server-side processing. Is there a way to achieve this purpose?

  • sandysandy Posts: 913Questions: 0Answers: 236

    Hi @demetriol ,

    I think Colin meant to mention link to this blog post. You need to use the Editor Libraries to use SearchPanes on the server-side. These are open source and free to use, so you do not require an Editor license.

    Thanks,
    Sandy

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Ah yep, helps to include link! My apologies.

    C

  • demetrioldemetriol Posts: 8Questions: 3Answers: 0
    edited December 2020

    Hi, @sandy, thank you! Can I use Editor Libraries with Javascript/JSP? Is there an example?

    Thank you

  • sandysandy Posts: 913Questions: 0Answers: 236

    Hi @demetriol ,

    No sorry, the Editor Libraries cover integration with the PHP, NodeJS and .NET frameworks.

    Thanks,
    Sandy

  • demetrioldemetriol Posts: 8Questions: 3Answers: 0

    Thank you. Is there a way to add custom parameters while Datatables APIs send Ajax requests to the server? I would like to create custom search panes

  • sandysandy Posts: 913Questions: 0Answers: 236

    Hi @demetriol ,

    Yes you can change the data within the preXhr.

    Thanks,
    Sandy

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    The best way to add them is in ajax.data,

    Colin

This discussion has been closed.