Testing implementation of an autosearch functionality, which works. Probably wasted, as I suspect I can get this directly out of jqGrid
git-svn-id: file:///svn-source/pmgr/branches/ledger_transactions_20090605@112 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
@@ -99,15 +99,45 @@ jQuery(document).ready(function(){
|
||||
<div id="customer-pager" class="scroll" style="text-align:center;"></div>
|
||||
</div>
|
||||
|
||||
<input type="BUTTON" id="bsdata" value="Search" />
|
||||
<script type="text/javascript"><!--
|
||||
$("#bsdata").click(function(){
|
||||
jQuery("#customer-list").searchGrid(
|
||||
{sopt:['cn','bw','eq','ne','lt','gt','ew']}
|
||||
);
|
||||
});
|
||||
--></script>
|
||||
<div class="h">Search By:</div>
|
||||
<div>
|
||||
<input type="checkbox" id="autosearch" onclick="enableAutosubmit(this.checked)">Enable Autosearch
|
||||
</div>
|
||||
<div>Last Name<br>
|
||||
<input type="text" id="filt_last_name" onkeydown="doSearch(arguments[0]||event)" />
|
||||
<button onclick="gridReload()" id="submitButton" style="margin-left:30px;">Search</button>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript"><!--
|
||||
|
||||
var timeoutHnd;
|
||||
var flAuto = false;
|
||||
function enableAutosubmit(state) {
|
||||
flAuto = state;
|
||||
jQuery("#submitButton").attr("disabled",state);
|
||||
}
|
||||
|
||||
function doSearch(ev){
|
||||
if(!flAuto)
|
||||
return;
|
||||
|
||||
if(timeoutHnd)
|
||||
clearTimeout(timeoutHnd);
|
||||
|
||||
timeoutHnd = setTimeout(gridReload,500);
|
||||
}
|
||||
|
||||
function gridReload() {
|
||||
var str = jQuery("#filt_last_name").val();
|
||||
jQuery("#customer-list").setGridParam( {
|
||||
url: '<?php echo $url; ?>' + '?filt=1' +
|
||||
'&filtField=PrimaryContact.last_name' +
|
||||
'&filtString=' + str,
|
||||
page:1
|
||||
}).trigger("reloadGrid");
|
||||
}
|
||||
|
||||
--></script>
|
||||
|
||||
<?php
|
||||
/* <div><a href="#" onClick="$('#debug').html(htmlEncode($('#everything').html())); return false;">Get Table Code</a></div> */
|
||||
|
||||
Reference in New Issue
Block a user