File tree Expand file tree Collapse file tree 2 files changed +35
-6
lines changed Expand file tree Collapse file tree 2 files changed +35
-6
lines changed Original file line number Diff line number Diff line change 1
1
jQuery ->
2
- $ (" #skmz_search_table_name" ).on " change blur" , () ->
3
- console .log $ (this ).val ()
2
+ change_tr_display = ->
3
+ table_name = $ (" #skmz_search_table_name" ).val ()
4
+ column_type = $ (" #skmz_search_column_type" ).val ()
5
+ column_name = $ (" #skmz_search_column_name" ).val ()
6
+ $ (" tr.skmz_row" ).show ()
7
+ # TODO jQueryのオブジェクトが見つからなかった際のエラーに対応する
8
+ if table_name ? .trim ()
9
+ $ (" tr.skmz_row" ).each ->
10
+ regexp = new RegExp (" skmz_table_name .*" + table_name + " .*" )
11
+ unless $ (this ).find (" td.skmz_table_name:first" ).attr (" class" ).match (regexp)
12
+ $ (this ).hide ()
13
+ if column_type ? .trim ()
14
+ $ (" tr.skmz_row" ).each ->
15
+ regexp = new RegExp (" skmz_column_type .*" + column_type + " .*" )
16
+ unless $ (this ).find (" td.skmz_column_type:first" ).attr (" class" ).match (regexp)
17
+ $ (this ).hide ()
18
+ if column_name ? .trim ()
19
+ $ (" tr.skmz_row" ).each ->
20
+ regexp = new RegExp (" skmz_column_name .*" + column_name + " .*" )
21
+ unless $ (this ).find (" td.skmz_column_name:first" ).attr (" class" ).match (regexp)
22
+ $ (this ).hide ()
23
+
24
+ $ (" #skmz_search_table_name" ).on " keyup" , ->
25
+ change_tr_display ()
26
+
27
+ $ (" #skmz_search_column_type" ).on " change" , ->
28
+ change_tr_display ()
29
+
30
+ $ (" #skmz_search_column_name" ).on " keyup" , ->
31
+ change_tr_display ()
32
+
Original file line number Diff line number Diff line change 18
18
<% @schema . tables . each do |table | %>
19
19
< tbody >
20
20
<% table . columns . each_with_index do |column , i | %>
21
- < tr class ="<%= "skmz_ #{ table . name } skmz_ #{ column . type } skmz_ #{ column . name } " %> ">
22
- < td > <%= table . name %> </ td >
23
- < td > <%= column . type %> </ td >
24
- < td > <%= column . name %> </ td >
21
+ < tr class ="skmz_row ">
22
+ < td class =" <%= "skmz_table_name #{ table . name } " %> " > <%= table . name %> </ td >
23
+ < td class =" <%= "skmz_column_type #{ column . type } " %> " > <%= column . type %> </ td >
24
+ < td class =" <%= "skmz_column_name #{ column . name } " %> " > <%= column . name %> </ td >
25
25
</ tr >
26
26
<% end %>
27
27
</ tbody >
You can’t perform that action at this time.
0 commit comments