Not trigger a searching when clicked x in search box in IE10

Not trigger a searching when clicked x in search box in IE10

machinariummachinarium Posts: 17Questions: 0Answers: 0
edited August 2013 in DataTables 1.9
Hi, all,
I am not quite sure about how many of DataTables users would use IE10, but I believe there must be many. In IE10, you will see a x in the right end of one search box, if click x, the content of that search box will be empty. The weird thing is this behavior won't trigger a searching to server side. Actually, there is no x in Chrome and Firefox. I guess there definitely is something to do with IE10's new features or so. However, I could not locate its root cause and find the workaround. I've tested some of the examples of this website and the searching are not triggered either. Anyone has some clues about this?

Best regards,
Arthur Hu

Replies

  • allanallan Posts: 63,381Questions: 1Answers: 10,449 Site admin
    Which version of DataTables are you using? If its 1.9- then that a bizarre IE10 behaviour. If 1.10-pre then its still bizarre, but hopefully fixable.

    Allan
  • machinariummachinarium Posts: 17Questions: 0Answers: 0
    1.9.4. Sorry for my poor English. I can't get your point. Has it been fixed in 1.10-pre? If so, I can try it. If not, is there any solution for this?
  • allanallan Posts: 63,381Questions: 1Answers: 10,449 Site admin
    Its not a DataTables error, but rather an IE one. There is no `change` event fired when the `X` is clicked on in IE10. I've also just tried IE11 and it shows exactly the same error.

    There is some discussion about it here: http://blog.clicdata.com/2013/02/28/ie10-how-to-handle-the-search-event/ - and in various other forums / posts.

    It looks like the why to handle it is to remove the `X` from the display. Rubbish, but that's the way it goes...

    Allan
  • machinariummachinarium Posts: 17Questions: 0Answers: 0
    But the users of my app don't want to remove the X from the display, they think it's very convenient. Is 'change' the only event we can monitor? I suppose we can also monitor other events. Where can I find documents about how to add extra event handlers to the search box?

    Arthur
  • machinariummachinarium Posts: 17Questions: 0Answers: 0
    I know it's a terrible idea to ask questions in question. But I thought this question is quite close to the original question. When I do a cut operation to the text of search box using Mouse, a change event also won't be triggered no matter in which browser.

    Thanks
  • allanallan Posts: 63,381Questions: 1Answers: 10,449 Site admin
    This appears to be the only solution in terms of keeping the little `x` : http://stackoverflow.com/questions/14498396/event-fired-when-clearing-text-input-on-ie10-with-clear-icon . So yes it is possible - but its damn ugly and something I really don't want to have to put into DataTables.

    I'll look into the cut operation issue.

    Allan
  • machinariummachinarium Posts: 17Questions: 0Answers: 0
    Allan,
    Thanks for your reply. And I followed your provided link. The code [code]$input.trigger('cleared')[/code] did not work. It still didn't trigger a searching to server. Is there anything I've missed?

    Best regards,
    Arthur
This discussion has been closed.