When I enter some text in filter column text area and try to clear it using "clear" button from tool bar my code behind code is doing it but its taking time to clear the text. The loading panel is shown and then it goes off and after sometime the filter text areas gets cleared.
"That mean there is delay in actual render (cleared text areas) and loading panel show time"
foreach
(GridColumn column in grdA.MasterTableView.Columns)
{
column.CurrentFilterFunction =
GridKnownFunction.NoFilter;
column.CurrentFilterValue =
string.Empty;
}
grdA.MasterTableView.FilterExpression =
string.Empty;
grdA.DataSource = AccountSummaryList;
grdA.DataBind();
I tried to show the "loading panel" using RadAjaxManager request start and responce end but its not showing the loading panel. I did this on Master page;
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" >
<ClientEvents OnRequestStart="RequestStart" OnResponseEnd="ResponseEnd" />
</telerik:RadAjaxManager>
<script type="text/javascript">
var currentLoadingPanel = null;
var currentUpdatedControl = null;
function RequestStart(sender, eventArgs) {
if (eventArgs != undefined) {
var initControl = eventArgs.get_eventTarget();
if (initControl == 'ctl00$cph1$myToolBar') {
currentLoadingPanel = $find("<%= lp1.ClientID %>"); //ajax loading lanel
currentUpdatedControl = $find("<%= cph1.ClientID %>"); //content panel
if (currentLoadingPanel != null) {
currentLoadingPanel.hide(currentUpdatedControl);
}
currentLoadingPanel.show(currentUpdatedControl);
}
}
}
function ResponseEnd(sender, eventArgs) {
if (currentLoadingPanel != null) {
currentLoadingPanel.hide(currentUpdatedControl);
}
currentUpdatedControl = null;
currentLoadingPanel = null;
}
</script>
Even after doing this there is delay in actual clear and loading panel show.
other things I tried ; are I added autopostback on toolbar - no use.
One this which is working for me but has issue is;
On client click of toolbar I am calling client function and clearing like this -
<script type="text/javascript">
function OnClientButtonClicked(sender, args) {
var button = args.get_item();
var txt = button.get_text();
if (txt == 'Clear') {
var masterTable = $find("<%= grdA.ClientID %>").get_masterTableView();
var columns = masterTable.get_columns();
for (var i = 0; i < columns.length; i++) {
var column = columns[i];
masterTable.filter(column._data.UniqueName,
"", Telerik.Web.UI.GridFilterFunction.StartsWith, true);
}
}
}
</script>
The above function is doing well. The problem with above code is whenever I typr something in filter text area of one column and try to type something in other filter couln it throws JS error as attached in this post.
If I change above code to ;
masterTable.filter("Location", "", Telerik.Web.UI.GridFilterFunction.StartsWith, true); // coulmn name
it is not throwing any error., but doesn't work fine.
Please let me know what is the issue with this code?
And for my entire problem if there are any other ways to do it?