<div>
<input type="text" id="textFilter">
<button id="buttonFilter" onClick="onFilterClick()">
Filter
</button>
<button id="buttonFilterSwitch" onClick="onFilterSwitchClick()">
Switch Type
</button>
</div>
<div id="Grid">
</div>
……………………………………………………………………………………………..
<script>
var _filterType;
function onFilterSwitchClick (args) {
var gridObj = $("#Grid").ejGrid("instance");
if (gridObj.model.filterSettings.filterType == "filterbar" )
_filterType = "excel";
else
_filterType = "filterbar";
gridObj.option({filterSettings: {filterType: _filterType}})
}
…………………………………………………………………………………………………..
</script>
|