Set selected item by default
Set selected item by default
m75sa
Posts: 132Questions: 30Answers: 0
I have the following example that works perfectly for me.
https://jsfiddle.net/4h0vyc45/55/
Just a question:
Is it possible to move the selected option menu on the right of the label? So next to the header label for example (not alone in the cel...) possible?
This question has an accepted answers - jump to answer
Answers
One option is to remove the
.empty()
when usingappendTo()
to append theselect
to theth
.https://jsfiddle.net/uoq39zmb/
Kevin
you are the best, as ever! Thanks
@kthorngren I'm using with ajax/server side processing... but seems to doesn't work... any idea?
What exactly doesn't work?
Kevin
i should replicate the issue.. .it's strange because if i don't use ajax and server side processing it works. will try to replicate so i hope you can help me
thanks in advance
hi, back again
this is the function that works when datas are not called via ajax (server side) but it doesn't when I use ajax...
I can see the select option menu but it doesn't filter...
With server side processing the filtering is done at the server script. Are you using a Datatables supplied server side processing script?
Kevin
yes, mysql db
can you help me with a sample so i can adapt? Thanks a lot
Which Datatables server side processing script are you using? It should support column searching.
Have you verified the Ajax request is sent to the server when using selecting a search option?
Have you verified the event hander fires when selecting a search option?
Can you post a link to your page or a test case replicating the issue so we can take a look?
https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin
the problem is that the test case doesn't read remote ajax file...
can i send you the .php called from ajax ?
Please provide details of what is not working and the troubleshooting you have done. Just posting code and saying it doesn't work does not provide enough details for us to help.
Kevin
agree, the problem is that it doesn't filter... so i can see the select option menu but when i change the item it loads for a second and the nothing changes...
I would like to replicate the issue with the testing code but the ajax call doesn't work on the testing area...
I don't use PHP and not familiar with it so I might be missing something but it doesn't look like your script is processing and using the column search values sent to the server. See the SSP Protocol docs for details.
Take a look at the ssp.class.php script used in the SSP examples. Maybe look at using the Editor libraries as described in this blog.
Kevin
I see this example:
https://datatables.net/examples/server_side/simple.html
now if i want to replicate it on jsbin or similar test case platform it doesn't work.
But maybe i found a way. Starting from this sample, if i need to filter the first column with a select option ?
In this way i can have a server side processing datas and the filtered function i need...
can you help me on this?
or in addition i found this that uses ajax call:
http://live.datatables.net/gihuqawi/5/edit
now if i want to add a select option on the first or second column?
You can get SSP templates here.
Kevin
i cannot find a way how to solve...
can you help me to add a filter here?
http://live.datatables.net/gihuqawi/5/edit
sorry and thanks