Created
February 27, 2010 13:41
-
-
Save RStankov/316696 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<select name="add_filter" id="add_filter"> | |
<option></option> | |
<option value="n_ticket" >Nº do ticket</option> | |
<option value="priority">Prioridade</option> | |
<option value="category">Categoria</option> | |
<option value="module">Módulo</option> | |
<option value="subject">Título</option> | |
<option value="date_sol">Data de solicitação</option> | |
<option value="solicitant">Solicitante</option> | |
<option value="status">Status</option> | |
<option value="percent">Percentual de conclusão</option> | |
<option value="available_date">Data de disponibilização</option> | |
</select> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.observe('dom:loaded', function(){ | |
if (!$('add_filter')) return; | |
var filterMap = { | |
n_ticket: ['t_id'], | |
priority: ['p_id'], | |
category: ['c_id'], | |
module: ['mod'], | |
subject: ['subj'], | |
date_sol: ['date_sol_year', 'date_sol_month', 'date_sol_day'], | |
solicitant: ['sol'], | |
status: ['s_id'], | |
percent: ['percentage'], | |
available_date: ['available_date_year', 'available_date_month', 'available_date_day'] | |
}; | |
$('add_filter').observe('change', function(){ | |
var enable = filterMap[this.getValue()]; | |
if (enable){ | |
Effect.toggle(this.getValue(), 'appear'); | |
enable.each(enable_form); | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment