LoginSignup
0
0

More than 5 years have passed since last update.

Dotsのイベントカレンダーで絞込ではなくて、除外指定したい場合

Last updated at Posted at 2017-02-07

勉強会、イベントを探すとき、dotsのイベントカレンダーをよく使んだけれど、絞り込んで探すんじゃなくて、特定のキーワード以外で探したいときが時々ある。
例:最近、人工知能とか機械学習とか流行ってるみたいだけど、自分には難しいので行かなくていいやとか。女子会、学生限定とか除外したいとか。

そんな機能はないので、強引に、テキストボックスと、ボタンをJavascriptで埋め込んで、
テキストボックスに除外キーワードを入れて、削除ボタンを押すと、除外キーワードを含むイベントが消えるようにした。

下記のJavascriptをdotsのイベントカレンダー上で、ブラウザのコンソールに打ち込む、またはブックマークレットで実行。


function xx(){$(".events li:contains('"+ $("#o").val()+"')").remove()} $('[name=event]').append('<br><input type="text" id="o" ><button class="pageheader-search-btn" type="button" onclick="xx()" >削除</button>');


やってることは、画面上部のformエリアにテキストボックスと、削除ボタンをJQueryで埋め込んで、

$('[name=event]').append('<input 〜 > <button 〜 >削除</button>')

下記のJQueryの指定で、除外キーワードを含む行を削除しているだけ。

$(".events li:contains('除外キーワード')").remove()

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0