Skip to content

Commit

Permalink
New feature: dropdown inline search options for jqGrid survey list (u…
Browse files Browse the repository at this point in the history
…seful for active/expired/inactive)
  • Loading branch information
jcleeland committed Jul 22, 2012
1 parent 383e06f commit 54251ad
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
11 changes: 11 additions & 0 deletions application/views/admin/survey/listSurveys_view.php
Expand Up @@ -24,4 +24,15 @@
</script>
<br/>
<table id="displaysurveys"></table> <div id="pager"></div>
<select id='gs_status_select' style='display: none'>
<option value=''><?php $clang->eT("Any") ?></option>
<option value='--a--'><?php $clang->eT("Expired") ?></option>
<option value='--e--'><?php $clang->eT("Inactive") ?></option>
<option value='--c--'><?php $clang->eT("Active") ?></option>
</select>
<select id='gs_access_select' style='display: none'>
<option value=''><?php $clang->eT("Any") ?></option>
<option value='Open'><?php $clang->eT("Open") ?></option>
<option value='Closed'><?php $clang->eT("Closed") ?></option>
</select>
<br />
24 changes: 24 additions & 0 deletions scripts/admin/listsurvey.js
Expand Up @@ -148,4 +148,28 @@ $(document).ready(function(){
$('.wrapper').width($('#displaysurveys').width()*1.006);
$('.footer').width(($('#displaysurveys').width()*1.006)-10);

/* Trigger the inline search when the status list changes */
$('#gs_status_select').change(function() {
$("#gs_status").val($('#gs_status_select').val());
var e = jQuery.Event("keydown");
$("#gs_status").trigger(e);
});
/* Trigger the inline search when the access list changes */
$('#gs_access_select').change(function() {
$("#gs_access").val($('#gs_access_select').val());
var e = jQuery.Event("keydown");
$("#gs_access").trigger(e);
});
/* Change the text search above "Status" icons to a dropdown */
var parentDiv=$('#gs_status').parent();
parentDiv.prepend($('#gs_status_select'));
$('#gs_status_select').css("display", "");
$('#gs_status').css("display", "none");
/* Change the text search above "Access" to a dropdown */
var parentADiv=$('#gs_access').parent();
parentADiv.prepend($('#gs_access_select'));
$('#gs_access_select').css("display", "");
$('#gs_access').css("display", "none");


});

0 comments on commit 54251ad

Please sign in to comment.