how to create server side datatables specifically for select option(dropdown list )

how to create server side datatables specifically for select option(dropdown list )

husainhusain Posts: 5Questions: 1Answers: 0

Hello Sir , I have Searched but there is no reply for my Issue,
I have more than 10000 records and I want to display Name and Id inside dropdown list(not inside table or row) simply with php is possible but it has loading.
or I want have only dropdown list not table records

in bellow example I dont want to have table I only want dropdown list
<select id="example">
<option> data come from datatables</option>
</select>

Thank you.

Answers

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

    See Allan's first comment in this thread for the way to handle this.

    Kevin

  • husainhusain Posts: 5Questions: 1Answers: 0

    @kthorngren thank you for your answer but I don't want to include my select option inside table , I want to use my select option as whole table.

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

    I want to use my select option as whole table

    Do you mean you want the select options listed in a column in a table? Or just a select control outside of the table?

    Colin

  • husainhusain Posts: 5Questions: 1Answers: 0

    @Colin yes Sir ! I want just a select control outside of the table not relate to table ?

  • husainhusain Posts: 5Questions: 1Answers: 0

    if my suggestion is not possible , even by default I don't want to show all the data inside select option , when I search items all items should be appear inside dropdown list , then I can manage the dropdown list id and name.

    for now by default all my records (10000 items) are display inside select control,
    and only problem is: it has loading... if I do with datatables.net server side it will not have loading.

  • kthorngrenkthorngren Posts: 21,343Questions: 26Answers: 4,954
    edited September 2022

    I want just a select control outside of the table not relate to table ?

    I might not understand what you mean but this wouldn't be controlled by Datatables. Use a jQuery ajax() request to the server to fetch the options you want. In the success function build your options list.

    Kevin

  • husainhusain Posts: 5Questions: 1Answers: 0

    @kthorngren yes this jQuery ajax() was my second option, I knew about this,
    but I thought it is possible with datatables.
    thank you.

Sign In or Register to comment.