1) My WebDropDown has multi-select checkbox functionality with “Select All” feature implemented through the client-side SelectionChanged event.
2) Now if I implement the server-side OnSelectionChanged event by enabling the AutoPostBackFlags-SelectionChanged=”On”, on selecting an element I get a pop-up error saying “Stop running this script? A script on this page is causing Internet Explorer to run slowly. If it continues to run, your computer may become unresponsive.” Also the event gets fired after every selection whereas we want the event to execute only after all the selections are done and when the dropdown is closed.
3) I tried implementing this solution from the forum but it doesn’t help - http://community.infragistics.com/forums/t/32575.aspx
<script type="text/javascript">
function selectedIndexChanged(sender, eventArgs) {
/*
*/
}
function dropDownClosed(sender, args) {
var dd = sender._callbackManager.createCallbackObject();
sender._callbackManager.execute(dd, true);
</script>
<ig:WebDropDown ID="WebDropDown1" runat="server" Width="200px" EnableMultipleSelection="True" EnableClosingDropDownOnSelect="False" OnSelectionChanged="WebDropDown1_SelectionChanged">
<ClientEvents SelectionChanged="selectedIndexChanged" DropDownClosed="dropDownClosed" />
</ig:WebDropDown>
This fires the server-side event after the selections are done and when the dropdown is closed but leaves the dropdown still open.
I will appreciate any help from the user community!
Hi,
if you don't want to have a postback after every selection, then you shouldn't set AutoPostBackFlag to On or Async. It is not possible to cancel selection and have selection at once at the same time, once the list is closed.
I suggest the following approach - keep your current code, but only remove the autopostback flags settings, so that there is no postback.
In the DropDownClosed client-side event handler, do that:
It's always good to also put a flag, so that in the closing handler, it knows when to do postback. I.e. do postback only when there was change in the selection. Otherwise it will do an async postback everytime the dropdown is closed.
If this doesn't help and the dropdown is still open, i would handle the Initialize client-side event, check whether the dropdown is open and if it is , close it, or just always close it by calling this function:
dropDown.closeDropDown();
Then the functions that you already have become like this:
var selectionChanged = false;
selectionChanged=true;
if (selectionChanged)
{
selectionChanged=false;
This should work fine, i don't know why it leaves the dropdown still open. Could you try and let me know whether it works?
Thanks,
Angel
Angel,
Thank you for your response.
I tried both of your solutions and both didn't work.
Initialize client-side event is called only for the first time and not after the async post-back following the DropDownClosed client-side event thus leaving the dropdown open.
The second option using the variable selectionChanged helped in not doing an async post-back the 2nd time but it still keeps the dropdown open.
I would appreciate any more ideas!
Thanks
I'm in the same boat with the WebDropDown.
I'm using v9.2. My datasource has approx 1400 items.
The page loads fine. I can open the Webdropdown w/no problem. Items display properly, paging works properly. Filtering works.
Generally the problem comes when I do a postback or try to leave the page. Up comes the IE "Stop running this script" dialog. Usually it takes selecting "No" 2 or 3 times before execution continues.
My webdropdown..
<ig:WebDropDown ID="WebDropDown4" runat="server" Width="100%" DataSourceID="SqlDataSource_Agencies" DropDownAnimationType="Linear" DropDownContainerHeight="0px" DropDownContainerMaxHeight="500px" DropDownContainerWidth="400px" EnableDropDownAsChild="True" MultipleSelectionType="Checkbox" TextField="namestring" ValueField="pk" AutoFilterTimeoutMs="4000" AutoSelectOnMatch="False" EnableAutoCompleteFirstMatch="False" EnableAutoFiltering="Server" EnablePaging="True" EnableLoadOnDemand="true" EnableAnimations="False" EnableCachingOnClient="True" Font-Size="X-Small" PageSize="250"> <DropDownItemBinding TextField="namestring" ValueField="pk" /> <AutoPostBackFlags SelectionChanged="On" /> <ClientEvents /> </ig:WebDropDown>
I've tried a number of combinations of PostbackFlag, EnableCaching, etc. Same result.
I'll attempt to upload my page source.
BTW another issue with this Webdropdown is that no matter what I have tried, filtering seems to work for only the first 3 characters before it autoselects an entry no matter what AutoSelectOnMatch is set to.??
I'd upload source if I could figure out how.
Exactly which version are you using? Is it 9.2 build number 1015, or later?
Thank you,
9.2.20092.2025
Could you try with 2056?