search field ignore manually fired change and keypress events, why?
search field ignore manually fired change and keypress events, why?
I'm trying to programmatically enter the search text like so:
$('.dataTables_filter input').val('Singapore').trigger('change')
$('.dataTables_filter input').val('Singapore').trigger($.Event("keypress", { keyCode: 15 }))
But this doesn't trigger the search filter at all on datatable - why is that if i manually type in on the search field it works, what is the difference?
i need to filter the rows through a set of buttons and the easiest way for me to do this is to programmatically enter a search text on the search field.
$('.dataTables_filter input').val('Singapore').trigger('change')
$('.dataTables_filter input').val('Singapore').trigger($.Event("keypress", { keyCode: 15 }))
But this doesn't trigger the search filter at all on datatable - why is that if i manually type in on the search field it works, what is the difference?
i need to filter the rows through a set of buttons and the easiest way for me to do this is to programmatically enter a search text on the search field.
This discussion has been closed.
Replies
Allan
Allan