How to ajax sort on data of extra input fields

How to ajax sort on data of extra input fields

bluesapphirebluesapphire Posts: 17Questions: 0Answers: 0
edited August 2009 in General
Hi!
1- There is an example of 'min' , 'max'. How can I sort table on the basis of these values through AJAX call ?
2- Is there a way to hide/disable default 'search' input field ?

Thanks in advance

Replies

  • allanallan Posts: 54,909Questions: 1Answers: 8,606 Site admin
    Hi bluesapphire,

    1. Not quite sure what you mean. Most of the table DataTables will do all the filtering on the client-side - unless you are using server-side processing. If you are using sAjaxSource, then you could use the fnReloadAjax plug-in and pass some GET parameters to the server for it to do some processing with.

    2. Yes indeed. If you want to do it permanently just set bFilter to false. If you want to do it on the fly, just grab the wrappers ID for the filter and set it to display:none;

    Regards,
    Allan
  • bluesapphirebluesapphire Posts: 17Questions: 0Answers: 0
    Hi!
    Really thanks for prompt and helpful response.

    1- Sorry for not elaborating that much. Now will try my best . Kindly visit following link.

    http://www.lovemoney.com/loans/search.aspx?show=personal

    You can see, there are many sliders and checkboxes. When we slide a slider or tick a checkbox, then data table updates itself. My question is that is there any posibility in DATATABLES to check and get values of many input fields (checkboxes, text inputs etc ) at a time and send these values to server and get response from server against these many values and then update itself as per result sent by server.

    Another example is guru.com. Select any category. I have selected category (Programming and Databases). New page will open. On this page you can see a left pane. entering or selecting different values, center table updates itself as per received response from sever against sent values from left pane.

    Hope you will get idea what I was telling about.

    2- Can you explain with an example about your statement "If you want to do it on the fly, just grab the wrappers ID for the filter and set it to display:none;"

    Thanks in advance
  • allanallan Posts: 54,909Questions: 1Answers: 8,606 Site admin
    Hi bluesapphire,

    1. Okay - so my understand is that you want to load the data into DataTables only once, and then have DataTables do all the sorting, filtering etc as required by the input controls. Yes, this certainly can be done. What you will need to do is implement some custom filtering:

    Documentation: http://datatables.net/development/filtering
    Example: http://datatables.net/examples/api/range_filtering.html

    2. Sure thing. So assuming that the table in question has the id of "ProductResults", then the filtering element added to the DOM by DataTables will have the ID "ProductResults_filter" - see http://datatables.net/styling . So document.getElementById('ProductResults_filter').style.display = "none"; will hide it for you. display = "block"; will of course show it again.

    Regards,
    Allan
This discussion has been closed.