Jean-Francois
Top achievements
Rank 1
Jean-Francois
asked on 16 Jun 2008, 01:21 PM
Hi,
Is there a way to trap double click event on server-side event? I need to trap single click and double click to make a different action depending on what event is called.
Thank you!
Is there a way to trap double click event on server-side event? I need to trap single click and double click to make a different action depending on what event is called.
Thank you!
9 Answers, 1 is accepted
0
Poul Henningsen
Top achievements
Rank 1
answered on 16 Jun 2008, 02:23 PM
0
Sadrul
Top achievements
Rank 2
answered on 10 Aug 2011, 01:11 PM
Sir,
I also need the double click event. But I need to know how i can make a double click event option in RadPanelBar Item, RadPanelBar item click event is working fine, but i need to get the double click event. Or how can i make a custom double click event using the clickevent option.
I also need the double click event. But I need to know how i can make a double click event option in RadPanelBar Item, RadPanelBar item click event is working fine, but i need to get the double click event. Or how can i make a custom double click event using the clickevent option.
0
Hello Danilo,
Here is one possible workaround with jQuery:
Kind regards,
Peter
the Telerik team
Here is one possible workaround with jQuery:
<script type=
"text/javascript"
>
function
OnClientLoad(sender) {
var
$ = $telerik.$;
for
(
var
i = 0; i < sender.get_allItems().length; i++) {
var
item = sender.get_allItems()[i];
$(
".rpText"
, item.get_element()).dblclick(
function
(e) {
alert($(
this
).text());
});
}
}
</script>
<telerik:RadPanelBar ID=
"RadPanelBar1"
runat=
"server"
OnClientLoad=
"OnClientLoad"
>
Kind regards,
Peter
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Jayaprakash
Top achievements
Rank 1
answered on 26 Mar 2012, 01:09 PM
I also need the double click event. i want to handle it in server side. how to call server side code.
0
Hello,
You can use the approach from this help topic -
Manually Add an AJAX Request to a Client-Side Event of an HTML Element
Greetings,
Peter
the Telerik team
You can use the approach from this help topic -
Manually Add an AJAX Request to a Client-Side Event of an HTML Element
Greetings,
Peter
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Jayaprakash
Top achievements
Rank 1
answered on 29 Mar 2012, 02:18 PM
Peter,
double click function(highlighted in bold letters) get fired twice. i don't know why? which causes two postbacks one with Page.IsPostBack = false and one with true. what could be the reason? please help.
Thanks
Jayaprakash Krishnan
function OnClientLoad(sender) {
var $ = $telerik.$;
for (var i = 0; i <
sender.get_allItems
().length; i++) {
var
item
=
sender
.get_allItems()[i];
$(".rpText", item.get_element()).dblclick(function (e) {
var ajaxManager = $find("<%= ajaxManager.ClientID %>");
var value = sender.get_selectedItem().get_text() + '~' + sender.get_selectedItem().get_value();
ajaxManager.ajaxRequest(value);
});
}
}
double click function(highlighted in bold letters) get fired twice. i don't know why? which causes two postbacks one with Page.IsPostBack = false and one with true. what could be the reason? please help.
Thanks
Jayaprakash Krishnan
0
Hello Jayaprakash,
I am not sure what could be causing this. Does this prevent you from achieving the functionality you need?
Kind regards, Peter
the Telerik team
I am not sure what could be causing this. Does this prevent you from achieving the functionality you need?
Kind regards, Peter
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Jayaprakash
Top achievements
Rank 1
answered on 03 Apr 2012, 09:57 AM
Peter,
Thanks for your reply.
Yes , the code block getting executed two times and causing two postbacks. In server side Page_Load event am loading data if post back is false, because of this issue unnecessarily data getting loaded. below is the client side code
function OnClientLoad(sender) {
var $ = $telerik.$;
for (var i = 0; i <
sender.get_allItems
().length; i++) {
var
item
=
sender
.get_allItems()[i];
$(".rpText", item.get_element()).dblclick(function (e) {
var ajaxManager = $find("<%= ajaxManager.ClientID %>");
var value = sender.get_selectedItem().get_text() + '~' + sender.get_selectedItem().get_value();
ajaxManager.ajaxRequest(value);
});
}
}
<
telerik:RadPanelBar
ID
=
"radPanelTransfer"
runat
=
"server"
Style
=
"float: left"
Skin
=
"Windows7"
OnClientItemClicked
=
"OnClientItemClicked"
Width
=
"100%"
OnClientLoad
=
"OnClientLoad"
/>
Is it because of OnClientItemClicked event?
function OnClientItemClicked(sender, args) {
switch (sender._element.id) {
case 'radPanelGeneral':
DeselectOtherPanelItems($find("<%=radPanelProcessing.ClientID %>"));
DeselectOtherPanelItems($find("<%=radPanelTransfer.ClientID %>"));
DeselectOtherPanelItems($find("<%=radPanelOther.ClientID %>"));
DeselectOtherPanelItems($find("<%=radPanelFinancial.ClientID %>"));
break;
case 'radPanelProcessing':
DeselectOtherPanelItems($find("<%=radPanelGeneral.ClientID %>"));
DeselectOtherPanelItems($find("<%=radPanelTransfer.ClientID %>"));
DeselectOtherPanelItems($find("<%=radPanelOther.ClientID %>"));
DeselectOtherPanelItems($find("<%=radPanelFinancial.ClientID %>"));
break;
case 'radPanelTransfer':
DeselectOtherPanelItems($find("<%=radPanelProcessing.ClientID %>"));
DeselectOtherPanelItems($find("<%=radPanelGeneral.ClientID %>"));
DeselectOtherPanelItems($find("<%=radPanelOther.ClientID %>"));
DeselectOtherPanelItems($find("<%=radPanelFinancial.ClientID %>"));
break;
case 'radPanelOther':
DeselectOtherPanelItems($find("<%=radPanelProcessing.ClientID %>"));
DeselectOtherPanelItems($find("<%=radPanelTransfer.ClientID %>"));
DeselectOtherPanelItems($find("<%=radPanelGeneral.ClientID %>"));
DeselectOtherPanelItems($find("<%=radPanelFinancial.ClientID %>"));
break;
case 'radPanelFinancial':
DeselectOtherPanelItems($find("<%=radPanelProcessing.ClientID %>"));
DeselectOtherPanelItems($find("<%=radPanelTransfer.ClientID %>"));
DeselectOtherPanelItems($find("<%=radPanelOther.ClientID %>"));
DeselectOtherPanelItems($find("<%=radPanelGeneral.ClientID %>"));
break;
default:
break;
}
}
function DeselectOtherPanelItems(panel) {
var selectedItem = panel.get_selectedItem();
if (selectedItem != null)
selectedItem.set_selected(false);
}
What could be the reason?
Awaiting for your reply.
Thanks
Jayaprakash
0
Hello Jayaprakash,
What are you RadAjax settings? If you have a setting that says that RadPanelBar should update itself, can you remove it and test the case again?
Regards,
Peter
the Telerik team
What are you RadAjax settings? If you have a setting that says that RadPanelBar should update itself, can you remove it and test the case again?
Regards,
Peter
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.