Commit 75c17b28 authored by delanoe's avatar delanoe

Merge remote-tracking branch 'origin/romain-testing' into testing

parents 2474bb91 d72f5354
...@@ -2186,15 +2186,29 @@ function MainTableAndCharts( ngdata , initial , search_filter) { ...@@ -2186,15 +2186,29 @@ function MainTableAndCharts( ngdata , initial , search_filter) {
// bind a filter named 'my_state_filter' to dynatable.queries.functions // bind a filter named 'my_state_filter' to dynatable.queries.functions
MyTable.data('dynatable').queries MyTable.data('dynatable').queries
// selects on current state <=> shows only elements of specific list // selects on current state <=> shows only elements of specific list
// nb: possible value are in {0,1,2} (see terms.html > #picklistmenu) // (see terms.html > #picklistmenu)
.functions['my_state_filter'] = function(record,selectedValue) { .functions['my_state_filter'] = function(record,selectedValue) {
if (selectedValue == 'reset') { if (selectedValue == 'reset') {
// return (AjaxRecords[record.id].state >= 0) // return (AjaxRecords[record.id].state >= 0)
return true return true
} }
// for states, possible value are in {0,1,2}
else if (selectedValue <= 2) {
// return true or false
return (AjaxRecords[record.id].state == selectedValue)
}
// for values > max_state we can also select mono/multi
else if (selectedValue == 3) {
// one-word terms aka monograms aka monolexical terms
return (AjaxRecords[record.id]['name'].indexOf(" ") == -1)
}
else if (selectedValue == 4) {
// MWE aka multigrams aka polylexical terms
return (AjaxRecords[record.id]['name'].indexOf(" ") != -1)
}
else { else {
// return true or false console.error("unknown value in #picklistmenu :", selectedValue)
return (AjaxRecords[record.id].state == selectedValue) return true
} }
} }
......
...@@ -144,6 +144,8 @@ em { ...@@ -144,6 +144,8 @@ em {
<!-- <option value='1' selected="selected">Map terms only</option> --> <!-- <option value='1' selected="selected">Map terms only</option> -->
<option value='1'>Map terms only</option> <option value='1'>Map terms only</option>
<option value='2'>Stopwords only</option> <option value='2'>Stopwords only</option>
<option value='3'>One word terms only</option>
<option value='4'>Multiword terms only</option>
</select> </select>
</div> </div>
</h4> </h4>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment