Forum Forums Mecons Datatable search

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • magisystem
    Participant
    Post count: 24

    Hello, there’s a way to send additional parameter to the server-side datatable based on form component, not only a generic search but a more specific fields based search?

    tbremus
    Keymaster
    Post count: 32

    Hi, please check if the bc-ajax-param-* attribute meets your requirements:

    https://www.brecons.net/Documentation/Mecons?view=DatatableAjaxDatasource

    magisystem
    Participant
    Post count: 24

    Yes, this works for server side parameters. But for a client side text input or seelct input how I can send it back to the server for additional filtering options?

    Thanks a lot

    tbremus
    Keymaster
    Post count: 32

    In the next version of Mecons, the Tag Helper of Datatable provides a JavaScript instance of the Datatable. Then you can modify all options of the Datatable after serverside rendering.

    Try to override the data.source.read.params property of the Datatable in the next Mecons version:

    https://keenthemes.com/metronic/?page=docs&section=datatable#docs

    Hope that helps!

    magisystem
    Participant
    Post count: 24

    Hello, now I’m using built-in search function with textbox on top of datatables, but the method “.Search” seems to be not working. Do I need to use a specific name for the textbox?
    I followed this tutorial: https://www.brecons.net/Documentation/Mecons?view=DatatableAjaxDatasource

    tbremus
    Keymaster
    Post count: 32

    Did you tried this?

    datatable_c301e2128e914c419f9bad40277ff210.search("CN", "shipCountry");

    In the specified API method use the query[shipCountry] value from the IFormCollection parameter:

    [HttpPost]
    public DatatableAjaxResponse<ShipViewModel> Post(IFormCollection data)
    {
       string searchString = data["query[shipCountry]"]; // = "CN"
    }
Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.