This is a migrated thread and some comments may be shown as answers.

[Solved] OnClientItemsRequesting not working

2 Answers 225 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Sreedath
Top achievements
Rank 1
Sreedath asked on 22 May 2008, 12:30 PM
Hi,
       I have migrated from Rad controls for Asp.net  to Rad Controls for Ajax 2008.The implementaion of the load on demand was designed to not fire until 3 charaters were typed by the  user.
Sample code with previous version :

function

RequestHandler(comboBox, text, more)

{

var

intMinChar = 2;

var

txtLength = text.length;

if

(txtLength == undefined || txtLength <= intMinChar)

{

return false;

}

}

The above code worked fine.

But with the 2008 version we are using the below code:

function

OnClientItemsRequesting(sender, eventArgs)

{

//var context = eventArgs.get_context();

alert(eventArgs.get_text().length);

return false;

}
I am using the above code to test whether we are able to stop from firing the ItemRequested server side event.Even though i am returning false always.I am not able to stop firing the ItemRequested  event.

2 Answers, 1 is accepted

Sort by
0
Sreedath
Top achievements
Rank 1
answered on 22 May 2008, 12:41 PM
haa! got the solution.Just went through the documentation

function OnClientItemsRequesting(sender, eventArgs)

{

if (eventArgs.get_text().length < 3)

eventArgs.set_cancel(

true)

else

eventArgs.set_cancel(

false);

}

This solves the issue.

0
Veselin Vasilev
Telerik team
answered on 22 May 2008, 12:44 PM
Hi Sreedath,

Here is what you need to check: http://www.telerik.com/help/aspnet-ajax/combo_clientsideonclientitemsrequesting.html


Kind regards,
Veskoni
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
ComboBox
Asked by
Sreedath
Top achievements
Rank 1
Answers by
Sreedath
Top achievements
Rank 1
Veselin Vasilev
Telerik team
Share this question
or